masqmail-0.3.4/AUTHORS0000644000000000000000000000070211705501561014534 0ustar00usergroup00000000000000Project Founder and ~99% of coding done by: Oliver Kurth current project maintainer (since v0.2.22): markus schnalke Contributed code: src/base64/* by Oliver Kurth (GPL-2) src/md5/hmac_md5.* by markus schnalke (ISC License) src/md5/md5.* by Solar Designer (in the Public Domain) admin/rmail by luciano l. mannucci and Wietse Venema (no license applies) admin/mailq.wmbiffrc by Paolo (no license applies) masqmail-0.3.4/COPYING0000644000000000000000000004311011705501561014517 0ustar00usergroup00000000000000 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. masqmail-0.3.4/ChangeLog0000644000000000000000000010212011705501561015233 0ustar00usergroup00000000000000This ChangeLog file summarizes the (implementation) changes from the technical view. The code repository log file provides the changes in full detail. Have a look at the NEWS file for a summary of the changes in a less technical speach and with focus on compatibility. 0.3.4 Wed, 18 Jan 2012 09:21:54 +0100 * Reworked the route concept. Better names: ``online_routes'' is now known as ``query_routes'' and the ``local_net_route'' in now named ``permanent_routes''. Removed the idea of the localnet because it is only part of the more general concept: permanent routes. Removed `local_nets'; they are now represented by allowed_recipients in a permanent route. (See: examples/localnet.route) Now, there is no more abiguity between `local' and `local net'. Run admin/config-transition on your config to learn how to update it. * Switched the default group for masqmail from `trusted' to `mail'. * Fixed a problem with psb->remote_host, introduced in version 0.3.2 (changeset 412385b57dc4). * Fixed a bug in matching of allowed recipients. Thanks to Juergen Daubert for finding and reporting the issue. * Enabled auth support per default. * Removed support for openssl linking. It had been rarely used and could have caused legal problems. We don't miss functionality here, because we already have builtin MD5 support. * Removed ident support. This had been discussed on the mailing list in Oct 2011. * `local_hosts' now understands glob patterns like `*example.org'. * Lots of refactoring and removal of unused code. * Smaller cleanups of the man pages. 0.3.3 Wed, 31 Aug 2011 08:38:13 +0200 * Fixed a possible security problem, reported by John Lightsey. See Debian bug #638002. The return value of seteuid() calls was handled wrong or not at all. Now, the (already available) set_euidgid() function is used when possible. Additionally, removed the unnecessary identity change when writing into an already open file descriptor. * Added debug level 9 for msgs to stderr during reading config. * Fixed local-part only address patterns in route conditions. The man page claimed behavior that wasn't implemented up to now. Thanks to Juergen Daubert for the bug report. * Switched default listen address back from 127.0.0.1 to `localhost'. Better be straight-forward than too clever. 0.3.2 Fri, 03 Jun 2011 10:14:33 +0200 * Fixed an important bug with folded headers! The folded lines of a long header would be ignored in unpredictable cases. Also fixed another problem with folded headers and g_strconcat() in spool read. * Reworked allowed and denied addrs for routes to be more consistent and allow more flexible matching: - allowed_mail_locals + allowed_return_paths -> allowed_senders - not_allowed_mail_locals + not_allowed_return_paths -> denied_senders - allowed_rcpt_domains -> allowed_recipients - not_allowed_rcpt_domains -> denied_recipients * Reworked online_detect to the simpler online_query. Only pipe is supported now. Use online_query="/bin/cat /path/to/file" instead of online_detect=file online_file=/path/to/file and online_query="/path/to/some/script foo" instead of online_detect=pipe online_pipe="/path/to/some/script foo" See man page masqmail.conf(5) and admin/config-transition. * Removed protocol option from route config because it was somehow redundant. Now, if `pipe' is set, the protocol will be pipe, otherwise it'll be smtp. That's just natural. * Bugfix: off-by-one in pipe aliases * Null-terminated the decoded base64 strings. * Now the Received: headers are much friendlier to read. The header for locally (i.e. non-SMTP) received mail is changed to the format postfix uses. * Replaced header_fold() with a better implementation and improved the (yet) unused function header_fold(). * Made protocol names upper case, like RFC 5321 requires them. * Several improvements to the man pages. * As always: various refactoring. * Ran aclocal and autoconf. * Added a description of how I create a masqmail release. 0.3.1 Wed, 08 Dec 2010 18:03:04 -0300 * smtp_out.c: changed the SMTP greeting behavior to match RFC 2821 (always try EHLO first). Thanks to inne for pointing me on that. See also Debian bug #349211 * fail_msg.c: postmaster is now matched caseless, as required by RFC * cmdline arguments are now added to the recipient list instead of substracted, when -t is used * print version if called without arguments (see commit message or code) * added -bm for mode accept (it's the default but the other MTAs have it too) * calling masqmail as `newaliases' is now recognized * mark -qo (without argument) obsolete (see man page) * refactored the cmdline argument processing (-m is recognized, unknown -oXXX options are ignored now and some corner-cases covered) * operation modes are now enforced exclusive, fail otherwise * -q and -qo are non-exclusive * fixed -oem by removing it ;-) (see NEWS and docs/oem-option) * heavy refactoring in parse.c and deliver.c, plus various other refactoring * fixed `To: alice, bob' with -t. If rcpt headers contained an unqualified address followed by more addresses, they were not recognized. * created new functions manipulate_queue() and run_queue() and moved code from main() * replaced the loop-based alias_expand() with a new one that wraps the recursive alias_one() * removed ADDR_FLAG_NOEXPAND as it is not needed anymore * removed ACC_DEL_RCPTS because it's always used together with ACC_RCPT_FROM_HEAD * s/EXIT_SUCCESS/0/ && s/EXIT_FAILURE/1/ * made addr_isequal() and addr_isequal_parent() more flexible, thus making addr_isequal_alias() needless and removed * merged rcptlist_with_one_of_hostlist() and rcptlist_with_addr_is_local() into split_rcpts() * removed the obsolete pos argument from time_interval() * renamed the default route for the local net to `default local_net_route' * renamed `alias_local_caseless' to `caseless_matching' because it does not only affect the matching of local parts of aliases anymore but is used anywhere where address matching is performed * renamed conf.alias_local_cmp to conf.localpartcmp * minor improvements of debug messages * heavily improved and updated man/masqmail.8 * several, mostly cosmetic, cleanups 0.3.0 Fri, 23 Jul 2010 21:58:25 +0200 * new development branch (Attention: No backward compatibility guaranteed.) * removed POP3 support (also pop-before-smtp/smtp-after-pop) * removed maildir support * removed built-in mserver functionality * removed, already deprecated, `remote_port' config option * removed --disable-smtp-server and --with-glib-static configure options * exit if host_name is not set in conf file * local_hosts defaults to `localhost;foo;foo.example.org' now (generated from the value of host_name, here it would have been `foo.example.org') * listen on `localhost:25' now if listen_addresses is not set in the conf file. To not listen at all, set listen_addresses to the empty string. * set default values for log_dir, spool_dir, mail_dir * improved mservdetect * build resolvtest tool now, the code was already there * added setup guides * improved and simplified the example config * removed the old manual because it is really outdated now * better debug logging of outgoing SMTP dialogs * renamed misc/ to devel/ and contrib/ to admin/ * added admin/config-transition, to check for and inform about obsolete config options 0.2.28 Fri, 23 Jul 2010 09:58:56 +0200 * added STARTTLS support with external wrappers like openssl. Added a new route config option `instant_helo' therefore. * added misc/list-versions 0.2.27 Sun, 18 Jul 2010 22:40:04 +0200 * replaced the MD5 implementation with the one of Solar Designer * replaced hmac_md5.c with an own implementation of RFC 2104 * added authors of contributed parts to AUTHORS 0.2.26 Sun, 18 Jul 2010 10:28:43 +0200 * write a log message when the daemon starts up. Thanks to Juergen Daubert. * added a missing #include to local.c. Thanks to Dominik Lang (phil). * improved documentation of `wrapper' in route files * fix handling of --with-liblockfile=no or --without-liblockfile. Thanks to Nico Roeser. * documentation improvements in the INSTALL file and some man pages. Thanks to Nico Roeser. * added misc/update-manpage-date, a development helper script to update the date and version in man pages 0.2.25 Thu, 08 Jul 2010 00:49:36 +0200 * added server-side SMTP SIZE support. Thanks to Paolo. * always remove Bcc: headers from now on * never create headers from envelope recipients from now on * add ``To: undisclosed-recipients:;'' if no recipient header is present * added checks for too long addresses in SMTP dialog. Thanks to Paolo. * allow colons (`:') unquoted in config file. Thanks to Paolo. * new warnmsg.tpl.it. Thanks to Paolo. * don't install the tests any longer * remove all installed dirs but no generated data (logs, spooled files, config) * removed the ACC_NO_RECVD_HDR because it is never used * changed name ACC_NODOT_TERM to ACC_DOT_IGNORE for better understanding * fixed max_size_delete * added Paolo's mailq.wmbiffrc * better debugging output. Thanks to Paolo. * documented some, yet undocumented, config options * improved documentation of -t option * moved rmail to sbin and added man page for rmail(8) * several typo fixes in man pages and code comments * gen-dist: don't distribute mercurial files 0.2.24 Mon, 21 Jun 2010 10:07:32 +0200 * removed dead code in child.c * fixed closing of log files on receival of SIGHUP. See commit message and http://bugs.debian.org/536060 . * the daemon does reparent to init anymore if init is already its parent. This situation appears on SIGHUP receival. * fixed correct processing of mails with data lines longer 4096 chars. See commit message for details. * various refactoring * fixed is_ingroup() to check for the primary group of users * moved man page of mservdetect to section 1 * added rmail script from postfix which is a bit better than calling masqmail as rmail. See docs/uucp-setup * permissions.c describes how to make another group (e.g. `uucp') trusted * uninstall target removes now docs and thelike * minor updates in the documentation 0.2.23 Sun, 30 May 2010 21:00:44 +0200 * fixed inverted condition for undefined online_file. Thanks to Juergen Daubert. * masqmail installs to /usr/local by default now. Previously it installed to /usr. * man pages get installed again. Again thanks to Juergen Daubert. Docs and examples do get installed now too. * updated the docs. Moved the man pages from docs/ to man/. Added the old manual from the old website to the distribution. * reworked the test cases completely. * updated the README file and added a bug report howto * fixed dist-gen (wrong paths for md5sum) 0.2.22 Thu, 20 May 2010 21:19:56 +0200 * new maintainer: markus schnalke . See NEWS. * fixed expanding of $prefix for template files. Thanks to Johann Felix Soden. * fixed delivery with empty or non-existent alias files. Thanks to Marcos Dione. * fixed empty or only-whitespace connection names. * fixed typos, reported by Reuben Thomas. * corrected man page about /etc/aliases. Thanks to Alexis. * further corrections and improvements in man pages. Man pages will be maintained in the nroff code directly in future. * removed distribution specific data from repo. It is now separately available on the website. * changed default online status file to /var/run/masqmail/masqmail-route * removed trigraph warnings 0.2.21 Mon, 07 Nov 2005 14:09:21 -0800 * do not use shell when executing sub programs (security fix) * do not accept backtick in email adresses (security fix) * write log files as 'mail' user (security fix) * use /var/run/masqmail/ for pid files 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 masqmail-0.3.4/INSTALL0000644000000000000000000001230611705501561014520 0ustar00usergroup00000000000000Additional information may be available in docs/ or on the website. For installing on GNU/Linux distributions read docs/INSTALL.linux. Installation instructions ------------------------- To compile masqmail you need glib (>= 1.2) (http://www.gtk.org). Your distribution probably provides it. Glib-2.0 works out of the box, for glib-1.2, you need to adjust configure.ac. See the comment in there. You need a user and a group for masqmail to run. If grep '^mail:' /etc/passwd grep '^mail:' /etc/group shows that the user `mail' and the group `mail' exist, it's probably best to use these. If they don't exist, create them: groupadd -g 12 mail useradd -u 8 -g mail -d /nonexistent -s /bin/false -c "masqmail MTA" mail The 8 and 12 are common uid/gid for the user and group `mail', but you can use any (not yet used) number you like, preferably one lower than 100. If you use other names than `mail' and `mail', you need to use the configure options described below. Compiling is a matter of the usual procedure. In the source directory, after unpacking do: ./configure make make install Additional options for configure -------------------------------- See the output of ./configure -h Here is a selection of the options with additional explanations: --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 'mail'. 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/log/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/. --disable-resolver disables 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. --disable-auth disables ESMTP AUTH support (enabled by default) --disable-debug disables debugging; setting it on the command line or in the configuration has no effect. Strongly discouraged, since you miss valuable information if something goes wrong. Checking the installation ------------------------- Check that 'make install' worked correctly. The following command: ls -ld /usr/local/sbin/masqmail /etc/masqmail /var/log/masqmail/ \ /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/* should give output similar to -rwsr-xr-x 1 root root 399356 May 10 12:34 /usr/local/sbin/masqmail drwxr-xr-x 2 root root 4096 May 10 12:34 /etc/masqmail drwxr-xr-x 2 mail mail 4096 May 10 12:34 /var/log/masqmail drwxr-xr-x 2 mail mail 4096 May 10 12:34 /var/run/masqmail drwxr-xr-x 5 mail mail 4096 May 10 12:34 /var/spool/masqmail drwxr-xr-x 2 mail mail 4096 May 10 12:34 /var/spool/masqmail/input drwxr-xr-x 2 mail mail 4096 May 10 12:34 /var/spool/masqmail/lock Important are the set-user-id bit for /usr/local/sbin/masqmail and the permissions of all files. Making masqmail the default --------------------------- `sendmail' is the de-facto standard name of the system's MTA, no matter which MTA actually runs. If you want to make masqmail the system's MTA (i.e. replace sendmail, postfix, etc), make two symbolic links: ln -s /usr/local/sbin/masqmail /usr/lib/sendmail ln -s /usr/local/sbin/masqmail /usr/sbin/sendmail Now every mailer that used to call sendmail will now call masqmail. If you already had an MTA installed and running, you can kill it and start masqmail. Probably with: /etc/init.d/sendmail restart If this doesn't work as expected, you might need to add a special init script for masqmail. Currently none is distributed with masqmail. (Hopefully this will change soon.) Please ask on the mailing list for help. You can also directly start masqmail as daemon with: /usr/local/sbin/masqmail -bd -q30m Basic Configuration ------------------- The only thing you must configure in order to use masqmail is the hostname. It's the name under which masqmail operates. In most cases it is the same as the machine's name, but it can be different. The script `admin/guess-hostname' tries to print the hostname of your machine. The first output line is probably the best choice. Create a minimal config with: echo "host_name = HOSTNAME" >/etc/masqmail/masqmail.conf (Substitute `HOSTNAME' with the real value, of course.) Such a setup (i.e. the default one) does: - deliver mail locally - accept mail on stdin (plain text) - accept mail on stdin (SMTP) (if started with -bs) - accept mail on the local port 25 (SMTP) (if started with -bd) It does not - transfer mail to other machines - accept mail from outside your machine For more elaborate setups, have a look at docs/*setup and docs/INSTALL*. You can also take the example configuration files in examples/ as basis for your own. Take the man pages masqmail.conf(5) and masqmail.route(5) for reference. All configuration files should go into /etc/masqmail. Written by oku. Improved by meillo. masqmail-0.3.4/Makefile.am0000644000000000000000000000374411705501561015531 0ustar00usergroup00000000000000EXTRA_DIST = examples docs man tpl devel SUBDIRS = src man install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir doc_dir rmail uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-run_dir rm-spool_dir rm-log_dir conf_dir: install -d $(DESTDIR)@with_confdir@ rm-conf_dir: rmdir $(DESTDIR)@with_confdir@ # removes only if empty tpl_dir: install -d $(DESTDIR)@datadir@/masqmail/tpl cp tpl/* $(DESTDIR)@datadir@/masqmail/tpl chmod 644 $(DESTDIR)@datadir@/masqmail/tpl/* rm-tpl_dir: rm -rf $(DESTDIR)@datadir@/masqmail/ doc_dir: install -d $(DESTDIR)@docdir@ cp -r docs $(DESTDIR)@docdir@ cp -r examples $(DESTDIR)@docdir@ cp ChangeLog NEWS AUTHORS COPYING README TODO INSTALL THANKS $(DESTDIR)@docdir@ rm-doc_dir: cd $(DESTDIR)@docdir@ && ( \ rm -rf docs examples ; \ rm -f ChangeLog NEWS AUTHORS COPYING README TODO INSTALL THANKS ; \ ) rmdir $(DESTDIR)@docdir@ run_dir: install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail rm-run_dir: rm -rf $(DESTDIR)/var/run/masqmail log_dir: install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@ rm-log_dir: rmdir $(DESTDIR)@with_logdir@ # removes only if empty spool_dir: 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 rm-spool_dir: : # removal fails if the dirs are non-empty : # this prevents losing spooled files rmdir $(DESTDIR)@with_spooldir@/lock rmdir $(DESTDIR)@with_spooldir@/input rmdir $(DESTDIR)@with_spooldir@ rmail: [ -d "$(DESTDIR)@prefix@/sbin" ] || mkdir -p "$(DESTDIR)@prefix@/sbin" sed '/^SENDMAIL/s,/usr/sbin/sendmail,$(DESTDIR)@prefix@/sbin/masqmail,'\ admin/rmail >$(DESTDIR)@prefix@/sbin/rmail chmod 755 $(DESTDIR)@prefix@/sbin/rmail rm-rmail: rm -f $(DESTDIR)@prefix@/sbin/rmail uid_bit: $(DESTDIR)@prefix@/sbin/masqmail chmod u+s $(DESTDIR)@prefix@/sbin/masqmail masqmail-0.3.4/Makefile.in0000644000000000000000000005700311705501561015537 0ustar00usergroup00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ THANKS TODO acconfig.h config.guess config.sub depcomp \ install-sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ 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@ GREP = @GREP@ INSTALL = @INSTALL@ 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@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RESOLV_LIBS = @RESOLV_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_confdir = @with_confdir@ with_group = @with_group@ with_logdir = @with_logdir@ with_spooldir = @with_spooldir@ with_user = @with_user@ EXTRA_DIST = examples docs man tpl devel SUBDIRS = src man all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) 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: $(am__configure_deps) $(top_srcdir)/acconfig.h ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | 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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__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 ../.. && umask 077 && mkdir "$$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 \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-local install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir doc_dir rmail uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-run_dir rm-spool_dir rm-log_dir conf_dir: install -d $(DESTDIR)@with_confdir@ rm-conf_dir: rmdir $(DESTDIR)@with_confdir@ # removes only if empty tpl_dir: install -d $(DESTDIR)@datadir@/masqmail/tpl cp tpl/* $(DESTDIR)@datadir@/masqmail/tpl chmod 644 $(DESTDIR)@datadir@/masqmail/tpl/* rm-tpl_dir: rm -rf $(DESTDIR)@datadir@/masqmail/ doc_dir: install -d $(DESTDIR)@docdir@ cp -r docs $(DESTDIR)@docdir@ cp -r examples $(DESTDIR)@docdir@ cp ChangeLog NEWS AUTHORS COPYING README TODO INSTALL THANKS $(DESTDIR)@docdir@ rm-doc_dir: cd $(DESTDIR)@docdir@ && ( \ rm -rf docs examples ; \ rm -f ChangeLog NEWS AUTHORS COPYING README TODO INSTALL THANKS ; \ ) rmdir $(DESTDIR)@docdir@ run_dir: install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail rm-run_dir: rm -rf $(DESTDIR)/var/run/masqmail log_dir: install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@ rm-log_dir: rmdir $(DESTDIR)@with_logdir@ # removes only if empty spool_dir: 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 rm-spool_dir: : # removal fails if the dirs are non-empty : # this prevents losing spooled files rmdir $(DESTDIR)@with_spooldir@/lock rmdir $(DESTDIR)@with_spooldir@/input rmdir $(DESTDIR)@with_spooldir@ rmail: [ -d "$(DESTDIR)@prefix@/sbin" ] || mkdir -p "$(DESTDIR)@prefix@/sbin" sed '/^SENDMAIL/s,/usr/sbin/sendmail,$(DESTDIR)@prefix@/sbin/masqmail,'\ admin/rmail >$(DESTDIR)@prefix@/sbin/rmail chmod 755 $(DESTDIR)@prefix@/sbin/rmail rm-rmail: rm -f $(DESTDIR)@prefix@/sbin/rmail uid_bit: $(DESTDIR)@prefix@/sbin/masqmail chmod u+s $(DESTDIR)@prefix@/sbin/masqmail # 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: masqmail-0.3.4/NEWS0000644000000000000000000005222511705501561014172 0ustar00usergroup00000000000000This NEWS file lists changes which may be important for you, especially in regard to compatiblity in upgrades. See ChangeLog file for more details and technical changes that don't affect users directly. The manual pages describe newly added options. Take them for reference. 0.3.4 - Reworked the route concept to be more general and have better names: ``online_routes'' is now known as ``query_routes'' and the ``local_net_route'' in now named ``permanent_routes''. Removed the idea of the localnet because it is only part of the more general concept: permanent routes. `local_nets' are now represented by `allowed_recipients' in a permanent route. (See: examples/localnet.route) Now, there is no more abiguity between `local' and `local net'. Run admin/config-transition on your config to learn how to update it. - Switched the default group for masqmail from `trusted' to `mail'. - Fixed a problem with psb->remote_host, introduced in version 0.3.2 (changeset 412385b57dc4). - Fixed a bug in matching of allowed recipients. Thanks to Juergen Daubert for finding and reporting the issue. - Configure options: Enabled auth support per default. Removed support for openssl linking. It had been rarely used and could have caused legal problems. We don't miss functionality here, because we already have builtin MD5 support. Removed ident support, which is hardly useful for masqmail. - `local_hosts' now understands glob patterns like `*example.org'. 0.3.3 - Fixed a possible security problem, reported by John Lightsey. Unwanted identity changes to the user root could have appeared. - Fixed local-part only address patterns in route conditions, as already described in the man page. 0.3.2 - Fixed an important bug with folded headers! In earlier versions mail to many recipients may, in unpredictable cases, only have been delivered to the ones on the first line. This is fixed now. Sorry for the inconvenience. - Reworked allowed and denied addrs for routes to be more consistent and allow more flexible matching: o allowed_mail_locals + allowed_return_paths -> allowed_senders o not_allowed_mail_locals + not_allowed_return_paths -> denied_senders o allowed_rcpt_domains -> allowed_recipients o not_allowed_rcpt_domains -> denied_recipients See man page masqmail.route(5). - Reworked online_detect to the simpler online_query. Only pipe is supported now. Use online_query="/bin/cat /path/to/file" instead of online_detect=file online_file=/path/to/file and online_query="/path/to/some/script foo" instead of online_detect=pipe online_pipe="/path/to/some/script foo" See man page masqmail.conf(5) and admin/config-transition. - Removed protocol option from route config because it was somehow redundant. Now, if `pipe' is set, the protocol will be pipe, otherwise it'll be smtp. - Now the Received headers are much friendlier to read. The header for locally (i.e. non-SMTP) received mail is changed to the format postfix uses. - Several improvements to the man pages. - Updated autoconf. 0.3.1 - Changed the SMTP greeting behavior to match RFC 2821 (always try EHLO first). Now always an EHLO greeting is sent first, no matter what kind of greeting text the server had sent. If the EHLO failes, an HELO greeting is tried as fall back. This change will fix setups in which it hadn't been possible to send mail because the server required AUTH but hadn't said ``ESMTP'' in its greeting message. Thanks to inne for pointing me on that. This fixes also Debian bug #349211. - The postmaster address is now matched caseless, as required by RFC. - -qo (without argument) is now considered obsolete. Its behavior (online detect and send over the available route) is included in -q. One may simply use -q instead. In the -qo case no local mail is sent, but why would be not want to do so? -qo (without arg) is still working but will likely change its behavior to something more useful in the future. - Command line address arguments are now added to the recipient list instead of substracted, when -t is used. This coveres a rare corner-case. It is a change from exim's behavior to postfix's. - Several changes were made related to the operation modes: The situation within the modes was made clear (see man page of masqmail(8)). If more than one mode is specified then masqmail aborts. For the default operation mode ``accept messages on stdin'' the command line switch -bm was added (similar to othe MTAs). If masqmail is called without arguments, the version information is printed now. - The command line option -m is recognized now (although ignored). Unknown -oXXX options are ignored. Some software (like spost of nmh) calls the MTA with -m. This is mainly a relict of old sendmail times but needed for compatibility. - The implementation of the command line option -oem had been weird. Now specifying -oem or -oee results in a (some kind of dumb but) logical behavior. Common users will probably not notice any difference. The changes affect only the exit code of the corner-case: Calling masqmail with -oem but without -oi/-i while submitting messages on stdin. - Fixed the recognition of lists of unqualified addresses in headers when using -t. E.g. `To: alice, bob'. - Renamed the config file option `alias_local_caseless' to `caseless_matching' because the option affects any address matching. - Renamed the default route for the local network to `default local_net_route'. This is only of interest for log/debug file studies. - Improved and updated the man page for masqmail(8), especially in respect to -oem which appears to be wrongly implemented. Minor improvements of debug messages. 0.3.0 - Start of the new development branch. Attention: Backward compatibility with 0.2.x versions will *NOT* be maintained. Upgrading from 0.2.x to 0.3.x will probably require manual adjustment of the configuration. The script admin/config-tansition can be used to check the config files for obsolete options. - Removed POP3 support (also pop-before-smtp/smtp-after-pop). Use some other POP3 client instead. - Removed maildir support. Use an MDA, like procmail, to deliver to maildir. - Removed the built-in mserver functionality. Use the mservdetect program instead. See masqmail.conf(5) under `online_pipe' for details. - Removed --disable-smtp-server and --with-glib-static configure options. We see no more need to not compile the SMTP server function. For static linking, see docs/howto-static-linking. - `host_name' is the only mandatory config option now. If you only set host_name, then masqmail will: o accept mail on the command line o listen on the local port 25 for incoming mail o deliver mail locally o not know how to handle mail for remote destinations Therefore you should set up at least one route configuration. - Default values are available for: listen_addresses, local_hosts, log_dir, spool_dir, mail_dir. See masqmail.conf(5) for the values. - Mservdetect works much better now. - Improved the documentation: o Added setup guides o Improved and simplified the example config And removed the old manual because it is really outdated now. - Renamed misc/ to devel/ and contrib/ to admin/. devel/ contains stuff for developers of masqmail, admin/ contains stuff for people who install, upgrade, and configure masqmail. 0.2.28 - Added STARTTLS support with external wrappers like OpenSSL. See `wrapper' and `instant_helo' in masqmail.route(5) for examples how to use it. `instant_helo' is a new route config option. 0.2.27 - Replaced contributed code with possible licensing problems with alternatives. The MD5 implementation changed from the reference implementation of RFC 1321 to the Public Domain implementation of Solar Designer. The HMAC-MD5 implementation changed from the reference implementation of RFC 2104 to an own implementation (ISC License). - Added the authors of contributed parts to the AUTHORS file. 0.2.26 - Write a log message when the daemon starts up. Thanks to Juergen Daubert. - Fix handling of --with-liblockfile=no or --without-liblockfile for configure script. Thanks to Nico Roeser. - Improved the INSTALL file and some man pages. Thanks to Nico Roeser Improved the documentation of the wrapper option of route files. 0.2.25 - Added server-side SMTP SIZE support. Thanks to Paolo. - Masqmail will from now on: o always remove Bcc: headers o never create headers from envelope recipients o add ``To: undisclosed-recipients:;'' if no recipient header (To: or Cc:) is present in the mail - Colons (`:') don't need to be quoted in the config file anymore. Thanks to Paolo. - Added checks for too long addresses in SMTP dialog. Thanks to Paolo. - Moved rmail to sbin and added a man page for it. - Added warnmsg.tpl.it. Thanks to Paolo. - The tests do not get installed any longer. All on install created dirs are removed on uninstall, except they contain generated data like logs, spooled files, or configuration. - Documented some, yet undocumented, config options. Several typo fixes in man pages and code comments. 0.2.24 - This version keeps on logging after an restart of the deamon, for instance when sending SIGHUP to the daemon process for rereading its config. - Now the daemon keeps the same process id when it receives SIGHUP to reread the config. - Mail messages with lines longer than 4096 characters do not get truncated anymore. - Fixed checking of the trusted group. Primary groups are now detected too. - Mservdetect's man page is now in section 1. - An `rmail' command is now included and gets installed with masqmail. See docs/uucp-setup for more information. - Docs and thelike, that masqmail installs, is removed on uninstall now. 0.2.23 - This release fixes a major bug in 0.2.22 which made online detection by file unusable. Thanks to Juergen Daubert for reporting and providing a patch. - Masqmail installs to /usr/local by default now. Previously it installed to /usr. To regain the old behavior, add --prefix=/usr to the configure call. - Man pages get installed again; in 0.2.22 they were not. Again thanks to Juergen Daubert. Docs and examples do get installed now too. - Updated the docs. Moved the man pages from docs/ to man/. Added the old manual from the old website to the distribution. Added a bug reporting howto. 0.2.22 - Hello, I'm meillo, the new maintainer and developer of masqmail. Oku handed masqmail over to me, because he wasn't active anymore. - This release includes various fixes for problems in 0.2.21, mainly based on bugs from Debian. - Distribution specific data has been excluded from the distribution, but is separately available on the project's website. - Man pages will not be generated from xml sources in future, but the nroff sources will be maintained directly. - The default online status file is now /var/run/masqmail/masqmail-route, as it already was in the Debian package. 0.2.21 - Retrospective: Probably, this version was not published in the usual way by oku. I (meillo) grabbed it from Debian's package archive. It does not introduce new functions but fixes security problems, such as writing log files as user `mail'. It also changes the location for pid files; they are stored in /var/run/masqmail/ now. 0.2.18 - delivery warnings and failures are now also implemented 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 connect_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_detect=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. masqmail-0.3.4/README0000644000000000000000000000554111705501561014352 0ustar00usergroup00000000000000Masqmail 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. Masqmail's website is: http://marmaro.de/prog/masqmail The email address of it's mailing list is: To subscribe yourself to the list, send a mail with the subject ``subscribe masqmail'' to . The mailing list archive is accessible at: http://lists.marmaro.de/masqmail/ . If you have any problems, contact me: markus schnalke . INSTALLATION ------------ For installation instructions, see INSTALL. BUGS ---- There are probably bugs in masqmail. Please report any one you discover to me. The more bug reports I get, the better masqmail will get. See docs/howto-report-bugs for detailed instructions. CREDITS ------- I would like to thank everyone who has submitted suggestions and bug reports. See THANKS. This file was originally written by by Oliver Kurth . Later updated and extended by markus schnalke . masqmail-0.3.4/THANKS0000644000000000000000000000202511705501561014377 0ustar00usergroup00000000000000Credits ------- 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. And for supplying a patch which made masqmail 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. Juergen Daubert for excellent bug reports including patches and various feedback. Paolo for a large patch improving several parts of masqmail, especially server-side SMTP SIZE support. ... and many others. See ChangeLog, the code repository log, and the mailing list for more. Feel free to tell me if you think you are missing on this list. This file was originally written by by Oliver Kurth . Later updated and extended by markus schnalke . masqmail-0.3.4/TODO0000644000000000000000000000075411705501561014163 0ustar00usergroup00000000000000Todo list for masqmail ---------------------- (Note: This file may not be up-to-date.) general: - look carefully were memory is not freed - add forwarding support - improve Mailer-Daemon error messages - ODMR support - temporary delivery delay notifications - check data types (int may only cover -32767 to +32767!) conf: - less configuration options - make conf more fool proof lookup: - optimize MX lookup ...update this file from time to time... ...and (you guessed it): - bug fixing masqmail-0.3.4/acconfig.h0000644000000000000000000000035111705501561015406 0ustar00usergroup00000000000000#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_AUTH #undef CONF_DIR #undef DATA_DIR #undef SBINDIR masqmail-0.3.4/aclocal.m40000644000000000000000000011703311705501561015332 0ustar00usergroup00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # 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]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 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_default([$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. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have 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_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif 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_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # 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]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. # 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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. # 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. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl 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])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) 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 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj 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 # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' 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 build --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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. 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 " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # 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. # serial 8 # 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 -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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. # 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_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # 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([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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. # serial 4 # 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 this is the am__doit target .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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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 ]) # Copyright (C) 2003, 2004, 2005, 2006 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _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], [m4_foreach_w([_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. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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)]) # Copyright (C) 2001, 2003, 2005 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. # AM_PROG_INSTALL_STRIP # --------------------- # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR masqmail-0.3.4/admin/README0000644000000000000000000000020611705501561015433 0ustar00usergroup00000000000000The files in admin/ are for system administrators and maybe for users too. They may be helpful but are not required to run masqmail. masqmail-0.3.4/admin/config-transition0000755000000000000000000001324211705501561020142 0ustar00usergroup00000000000000#!/bin/sh # # check masqmail config files for options that are obsolete # # 2010 markus schnalke if [ $# -eq 0 ] ; then echo "usage: config-transition CONFIGFILE..." >&2 exit 1 fi awkscript="/tmp/masqmail-config-transition-$$" trap 'rm -f "$awkscript"; exit' INT QUIT TERM EXIT cat >"$awkscript" < that you used this option. \ We still don't know the rationale behind this option. \ All we have is a comment in the code saying: This option is used by sqilconf. \ " check["protocol"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ If pipe is given, pipe will be used, otherwise smtp will be used. \ " check["(^|[ ])allowed_return_paths"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'allowed_senders'. \ " check["not_allowed_return_paths"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'denied_senders'. \ " check["(^|[ ])allowed_mail_locals"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'allowed_senders', if neither wildcards nor '@' is used. \ " check["not_allowed_mail_locals"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'denied_senders', if neither wildcards nor '@' is used. \ " check["(^|[ ])allowed_rcpt_domains"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'allowed_recipients', if the values are prepended with \ '*@', because 'allowed_recipients' matches complete addresses not just \ domains. \ " check["not_allowed_rcpt_domains"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ Replaced by 'denied_recipients', if the values are prepended with \ '*@', because 'allowed_recipients' matches complete addresses not just \ domains. \ " # get files # already covered by the get.* and online_gets.* options in the conf # file. This check is just to make sure, because one might only check # the get file. # We don't check for the other get file options, which are: # protocol server port wrapper user pass address return_path do_keep # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\ The POP3 client was removed from masqmail. \ Use a dedicated POP3 client, e.g. fetchmail, instead. \ " ######## END OF CHECK DEFINITIONS ######## } function checkcomment() { if (/^[ \t]*\#/) { return " (in a comment)" } } { for (key in check) { if (\$0 !~ key) { continue; } # we have a match split(check[key], a, SUBSEP); # array index starts with 1 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment()); cmd = "fold -sw 70 | sed 's,^,\t,'" print "\t>>>> " \$0 " <<<<" print a[3] | cmd close(cmd) print "\t" a[2] print "" } } ! for i do awk -f "$awkscript" "$i" done masqmail-0.3.4/admin/guess-hostname0000755000000000000000000000061711705501561017451 0ustar00usergroup00000000000000#!/bin/sh # # try several ways to guess the hostname # earlier output lines are probably better ( # this is what Debian uses cat /etc/mailname # probably a good value on GNU/Linux hostname -f # this is often the short hostname cat /etc/hostname # often the short hostname, but widely available hostname # this file was mentioned on the Internet cat /etc/HOSTNAME ) 2>/dev/null | uniq exit 0 masqmail-0.3.4/admin/mailq.wmbiffrc0000644000000000000000000000042311705501561017400 0ustar00usergroup00000000000000# mailq.wmbiffrc for masqmail by Paolo label.4=mailq path.4=shell:::mailq|grep ^[[:graph:]]|grep -v empty|wc -l interval.4=600 notify.4=beep notify.4=true action.4=(echo "messages in the queue:";mailq|grep ^[[:graph:]]|grep -v empty)|xmessage -center -buttons vaBen -file - masqmail-0.3.4/admin/rmail0000755000000000000000000000126511705501561015613 0ustar00usergroup00000000000000#!/bin/sh # # Dummy UUCP rmail command for postfix/qmail systems # # written by luciano l. mannucci # improved by Wietse Venema # see: # List: postfix-users # Subject: Rmail: very small fix # From: luke@nameron.smd.sublink.org (luciano l. mannucci) # Date: 2000-09-13 14:31:30 # URL: http://marc.info/?l=postfix-users&m=96885536302087 # # taken from postfix-2.5.5/auxiliary/rmail/rmail SENDMAIL="/usr/sbin/sendmail" IFS=" " read junk from junk junk junk junk junk junk junk relay case "$from" in *[@!]*) ;; *) from="$from@$relay";; esac exec $SENDMAIL -i -f "$from" -- "$@" masqmail-0.3.4/config.guess0000755000000000000000000012706111705501561016014 0ustar00usergroup00000000000000#! /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, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # 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 "$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 ;; sh5el) machine=sh5le-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 ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-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.*:* | i86xen: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:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *: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 ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [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 ;; avr32*: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 | sed -n ' /^CPU/{ s: ::g p }'`" 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 | sed -n ' /^CPU/{ s: ::g p }'`" 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 ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-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 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" 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 ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-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 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 ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos 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: masqmail-0.3.4/config.h.in0000644000000000000000000000721111705501561015511 0ustar00usergroup00000000000000/* 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_AUTH #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 the resolver is to be used */ #undef ENABLE_RESOLVER /* 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 /* The log directory */ #undef LOG_DIR /* 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 home page for this package. */ #undef PACKAGE_URL /* 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 /* The spool directory */ #undef SPOOL_DIR /* 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 /* 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 int' if does not define. */ #undef size_t masqmail-0.3.4/config.sub0000755000000000000000000007772411705501561015471 0ustar00usergroup00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # 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-newlib* | 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 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` ;; -sco5v6*) # 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 | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | 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 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) 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) ;; ms1) basic_machine=mt-unknown ;; # 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-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | 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-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | 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-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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 ;; cr16) basic_machine=cr16-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 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; 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 ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; 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 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; rdos) basic_machine=i386-pc os=-rdos ;; 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 ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; 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 | sparcv9v) 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* | -solidbsd* \ | -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-newlib* | -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* | -rdos* | -toppers* | -drops*) # 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 score-*) os=-elf ;; spu-*) os=-elf ;; *-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 ;; mep-*) os=-elf ;; 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: masqmail-0.3.4/configure0000755000000000000000000057234411705501561015413 0ustar00usergroup00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for masqmail 0.3.4. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and meillo@marmaro.de $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='masqmail' PACKAGE_TARNAME='masqmail' PACKAGE_VERSION='0.3.4' PACKAGE_STRING='masqmail 0.3.4' PACKAGE_BUGREPORT='meillo@marmaro.de' PACKAGE_URL='' ac_unique_file="src/masqmail.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS with_confdir with_spooldir with_logdir USE_LIBLOCKFILE LOCKFILE_LIBS MD5_LIBS BASE64_LIBS with_group with_user RESOLV_LIBS GLIB_LIBS GLIB_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG RANLIB EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_resolver with_user with_group enable_debug enable_auth with_liblockfile with_logdir with_spooldir with_confdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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.3.4 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/masqmail] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _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.3.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --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 build --enable-dependency-tracking do not reject slow dependency extractors --disable-resolver disable resolver support --disable-debug disable debugging --disable-auth disable AUTH (RFC 2554) client 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 mail --with-liblockfile use liblock (for Debian) --with-logdir=DIR set log directory /var/log/masqmail --with-spooldir=DIR set spool directory /var/spool/masqmail --with-confdir=DIR 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) 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 PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path 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 ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF masqmail configure 0.3.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to meillo@marmaro.de ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_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.3.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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.11' 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi 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.3.4' 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"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj 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 # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_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 environment variables GLIB_CFLAGS and GLIB_LIBS 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" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-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 $as_echo "#define ENABLE_RESOLVER 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lc" >&5 $as_echo_n "checking for res_search in -lc... " >&6; } if ${ac_cv_lib_c_res_search+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char res_search (); int main () { return res_search (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_res_search=yes else ac_cv_lib_c_res_search=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_res_search" >&5 $as_echo "$ac_cv_lib_c_res_search" >&6; } if test "x$ac_cv_lib_c_res_search" = xyes; then : need_resolv=no else need_resolv=yes fi if test "$need_resolv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 $as_echo_n "checking for res_search in -lresolv... " >&6; } if ${ac_cv_lib_resolv_res_search+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char res_search (); int main () { return res_search (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_res_search=yes else ac_cv_lib_resolv_res_search=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 $as_echo "$ac_cv_lib_resolv_res_search" >&6; } if test "x$ac_cv_lib_resolv_res_search" = xyes; then : has_resolv=yes; RESOLV_LIBS="-lresolv" else has_resolv=no fi if test "$has_resolv" = no; then saved_LIBS="$LIBS" LIBS="$LIBS -lresolv" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 $as_echo_n "checking for res_search in -lresolv... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { res_search (0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : RESOLV_LIBS="-lresolv"; has_resolv=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; LIBS="$saved_LIBS" fi if test "$has_resolv" = no; then as_fn_error $? "\"no libresolv\"" "$LINENO" 5 RESOLV_LIBS='' fi fi else RESOLV_LIBS='' fi for ac_func in getline do : ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" if test "x$ac_cv_func_getline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETLINE 1 _ACEOF fi done for ac_func in fdatasync do : ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FDATASYNC 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 () { return (!(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 if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in select socket strerror strstr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-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 was given. if test "${with_group+set}" = set; then : withval=$with_group; fi if test "x$with_group" = 'x'; then with_group='mail' fi # Check whether --enable-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 $as_echo "#define ENABLE_DEBUG 1" >>confdefs.h fi cat >>confdefs.h <<_ACEOF #define DEF_MAIL_USER "${with_user}" _ACEOF cat >>confdefs.h <<_ACEOF #define DEF_MAIL_GROUP "${with_group}" _ACEOF MD5_LIBS='' BASE64_LIBS='' # Check whether --enable-auth was given. if test "${enable_auth+set}" = set; then : enableval=$enable_auth; if test "x$enable_auth" != 'xno'; then auth_enabled='yes' fi else auth_enabled='yes' fi if test "x$auth_enabled" = xyes; then $as_echo "#define ENABLE_AUTH 1" >>confdefs.h BASE64_LIBS='base64/libbase64.a' need_md5='yes' fi if test "x$need_md5" = 'xyes'; then MD5_LIBS='md5/libmd5.a' fi # Check whether --with-liblockfile was given. if test "${with_liblockfile+set}" = set; then : withval=$with_liblockfile; fi if test "x$with_liblockfile" = 'xno'; then with_liblockfile='' fi if test "x$with_liblockfile" != 'x'; then with_liblockfile='yes' fi if test "x$with_liblockfile" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for maillock in -llockfile" >&5 $as_echo_n "checking for maillock in -llockfile... " >&6; } if ${ac_cv_lib_lockfile_maillock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llockfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char maillock (); int main () { return maillock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lockfile_maillock=yes else ac_cv_lib_lockfile_maillock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lockfile_maillock" >&5 $as_echo "$ac_cv_lib_lockfile_maillock" >&6; } if test "x$ac_cv_lib_lockfile_maillock" = xyes; then : has_lockfile=yes else as_fn_error $? "\"no liblockfile\"" "$LINENO" 5 fi LOCKFILE_LIBS='-llockfile' $as_echo "#define USE_LIBLOCKFILE 1" >>confdefs.h else LOCKFILE_LIBS='' fi # Check whether --with-logdir was given. if test "${with_logdir+set}" = set; then : withval=$with_logdir; else with_logdir='/var/log/masqmail/' fi cat >>confdefs.h <<_ACEOF #define LOG_DIR "${with_logdir}" _ACEOF # Check whether --with-spooldir was given. if test "${with_spooldir+set}" = set; then : withval=$with_spooldir; else with_spooldir='/var/spool/masqmail/' fi cat >>confdefs.h <<_ACEOF #define SPOOL_DIR "${with_spooldir}" _ACEOF # Check whether --with-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 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 src/Makefile src/base64/Makefile src/md5/Makefile man/Makefile" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by masqmail $as_me 0.3.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ masqmail config.status 0.3.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES 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" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_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 # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. 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 " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi masqmail-0.3.4/configure.ac0000644000000000000000000001267411705501561015765 0ustar00usergroup00000000000000dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(masqmail, 0.3.4, meillo@marmaro.de) AC_CONFIG_SRCDIR([src/masqmail.c]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE() 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) dnl # use the next line to use glib-1.2 dnl PKG_CHECK_MODULES(GLIB, glib) 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; RESOLV_LIBS="-lresolv", has_resolv=no) if test "$has_resolv" = no; then saved_LIBS="$LIBS" LIBS="$LIBS -lresolv" AC_MSG_CHECKING(for res_search in -lresolv) AC_TRY_LINK([#include ], [res_search (0, 0, 0, 0, 0);], RESOLV_LIBS="-lresolv"; has_resolv=yes; AC_MSG_RESULT(yes), AC_MSG_RESULT(no)); LIBS="$saved_LIBS" fi if test "$has_resolv" = no; then AC_MSG_ERROR("no libresolv") RESOLV_LIBS='' fi 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 [mail]], ) if test "x$with_group" = 'x'; then with_group='mail' 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 optional features MD5_LIBS='' BASE64_LIBS='' dnl auth support (default: use it) AC_ARG_ENABLE(auth, [ --disable-auth disable AUTH (RFC 2554) client support], if test "x$enable_auth" != 'xno'; then auth_enabled='yes' fi, auth_enabled='yes' ) if test "x$auth_enabled" = xyes; then AC_DEFINE(ENABLE_AUTH, 1, [If AUTH is enabled]) BASE64_LIBS='base64/libbase64.a' need_md5='yes' fi AC_SUBST(BASE64_LIBS) if test "x$need_md5" = 'xyes'; then MD5_LIBS='md5/libmd5.a' fi AC_SUBST(MD5_LIBS) dnl liblockfile AC_ARG_WITH(liblockfile, [ --with-liblockfile use liblock (for Debian)], ) if test "x$with_liblockfile" = 'xno'; then with_liblockfile='' fi 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/log/masqmail]], , with_logdir='/var/log/masqmail/' ) AC_DEFINE_UNQUOTED(LOG_DIR, "${with_logdir}", [The log directory]) AC_SUBST(with_logdir) AC_ARG_WITH(spooldir, [ --with-spooldir=DIR set spool directory [/var/spool/masqmail]], , with_spooldir='/var/spool/masqmail/' ) AC_DEFINE_UNQUOTED(SPOOL_DIR, "${with_spooldir}", [The spool directory]) AC_SUBST(with_spooldir) dnl configuration file AC_ARG_WITH(confdir, [ --with-confdir=DIR directory for configuration [/etc/masqmail]], , with_confdir='/etc/masqmail' ) AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location]) AC_SUBST(with_confdir) test "x$prefix" = xNONE && prefix="$ac_default_prefix" dnl well, /me/ thought that autoconf should make things _easy_ ... -- oku dnl I needed the two `eval's to get the variable expanded in all cases -- meillo dnl this is just horrible! -- meillo AC_DEFINE_UNQUOTED(DATA_DIR, "`eval 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 \ src/Makefile \ src/base64/Makefile \ src/md5/Makefile \ man/Makefile ) masqmail-0.3.4/depcomp0000755000000000000000000003305211705501561015045 0ustar00usergroup00000000000000#! /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 masqmail-0.3.4/devel/README0000644000000000000000000000015611705501561015446 0ustar00usergroup00000000000000The files in devel/ are for developers of masqmail. Especially, there are script to support doing a release. masqmail-0.3.4/devel/are-options-documented0000755000000000000000000000123011705501561021073 0ustar00usergroup00000000000000#!/bin/sh # # checks if all recognized options are documented # run from masqmail's repository root dir # # Note: this script is far from perfect, but its development time to # usage value ratio is quite good :-) docs="/tmp/masqmail-opts-docs.$$" code="/tmp/masqmail-opts-code.$$" cat man/masqmail.*.5 | grep -o '^\\fB[^(\\]*\\f.' | egrep -v 'OBSOLETE|http://' | sed 's,^\\fB,,; s,[\\ =].*,,' | sort -u | grep -v '^val$' >"$docs" cat src/conf.c | grep 'lval,.*"' | sed 's,[^"]*",,; s,"\, [0-9]*,",; s,".*,,' | sort -u >"$code" diff -U 0 "$code" "$docs" | grep -v '^@@' | sed 's/^---.*/--- code/;s/^+++.*/+++ docs/' rm -f "$docs" "$code" masqmail-0.3.4/devel/gen-dist0000755000000000000000000000057211705501561016230 0ustar00usergroup00000000000000#!/bin/sh # # generate a tar.gz archive to distribute # generate an md5sum and a detached signature of the archive # # requires: # - mercurial (hg) # - md5sum # - gnupg if [ $# -ne 1 -o -e "$1" ] ; then echo "usage: gen-dist DEST.tar.gz" 2>&1 exit 1 fi dir="${1%/*}" file="${1##*/}" hg archive -t tgz -X .hg\* "$1" cd "$dir" md5sum "$file" >"$file.md5sum" gpg -ab "$file" masqmail-0.3.4/devel/list-versions0000755000000000000000000000102311705501561017327 0ustar00usergroup00000000000000#!/bin/sh # # list the version numbers in several important files # run this script before generating a release ( grep '^AC_INIT' /dev/null configure.* printf "Changelog:" sed -n '/^[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}/{p;q}' ChangeLog printf "NEWS:" sed -n '/^[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}/{p;q}' NEWS grep '^\.TH' /dev/null man/*.[0-9] #) | sed 's~\([^:]*\):.*\([0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}\).*~\2 \1~' ) | awk -F: '{ file=$1; match($0, /[0-9]\.[0-9]+\.[0-9]+(-[A-Za-z0-9_+-]+)?/); print(substr($0, RSTART, RLENGTH) " " $1); }' masqmail-0.3.4/devel/update-manpage-date0000755000000000000000000000051211705501561020313 0ustar00usergroup00000000000000#!/bin/sh # # update the date and version of man pages if [ $# -lt 2 ] ; then echo "usage: update-manpage-header VERSION FILES..." >&2 exit 1 fi date=`date +%Y-%m-%d` version="$1" shift for i do ed -s "$i" <"; Do not forget the Charlie Miller. With connection method file, I get the following message in the log file: "Could not open /tmp/connect_route: Permission denied". ------------------------------------------------------------ In your ip-up script, you have to set read permission to the user masqmail runs as. After you write the file with the connection name, set read permission to all with chmod ugo+r file. With connection method file, I get the following message in the log file: "route with name name not found.". ----------------------------------------------------------- Check whether the name in the file is really identical to name you gave to the route configuration (case sensitive!). I found a bug. -------------- Make sure you are using the newest version, in case of doubt search it in freshmeat. If you do, tell me. See also the section bugs on the main page. I think I found a bug, but I am not sure whether I configured MasqMail incorrectly. ------------------------------------------------------------- Don't care. Tell me. Or write to the mailing list. Written by Oliver Kurth Last modified by him: Tue May 30 15:19:56 CEST 2000 masqmail-0.3.4/docs/INSTALL.agenda0000644000000000000000000000171511705501561016670 0ustar00usergroup00000000000000 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. masqmail-0.3.4/docs/INSTALL.ipaq0000644000000000000000000000053611705501561016403 0ustar00usergroup00000000000000For 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 masqmail-0.3.4/docs/INSTALL.linux0000644000000000000000000000110611705501561016602 0ustar00usergroup00000000000000Distribution specific stuff =========================== Debian ------ If you compile for Debian, do the configure with at least these options: ./configure --with-liblockfile 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 However, you better have a look at the official masqmail package in Debian. apt-get source masqmail is your friend. SuSE/Redhat ----------- There are spec files for rpm creation on the website. You may have to adjust these files. masqmail-0.3.4/docs/README0000644000000000000000000000006211705501561015273 0ustar00usergroup00000000000000Note: Parts of the documentation may be outdated. masqmail-0.3.4/docs/agenda-config.site0000644000000000000000000000337511705501561017775 0ustar00usergroup00000000000000# 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 masqmail-0.3.4/docs/howto-release0000644000000000000000000000435211705501561017122 0ustar00usergroup00000000000000How to do a masqmail release ============================ meillo 2010-12-09 This document helps me to not forget any steps and to document how I did it for any new maintainer who might come after me. This document was inspired by docs/README.developers of the nmh project. (1) Be sure that the current state of the project is ready to release. Test if it compiles. Test if it works (this should be done automatically with a better test suite). (2) Update ChangeLog and NEWS based on the VCS log. Don't forget to update the time of the ChangeLog entry. Check if contributions from others are acknowledged adequately (ChangeLog, THANKS). (3) Remove the -dev suffix from the version number in configure.ac. Run autoconf afterwards to transfer the change to the configure script. Build masqmail and run it with -bV to check the version. (4) Run devel/list-versions and devel/update-manpage-date afterwards to have the right version and date in the man pages. (5) Is everything checked in? (6) Run `make distclean', check for remaining files (just in case). `hg st' is helpful. Build anew: `./configure ... && make && sudo make install'. Check if everything went well. If so, `make distclean' again. Now we should be ready to release. (7) Run `devel/gen-release ../masqmail-0.x.y.tar.gz'. An md5sum will be generated automatically and a detached gpg signature will be created (this requires gnupg with a secret key). (8) Unpack the generated tarball and examine its contents (-t or -xv). Build masqmail anew from the tarball, see (6). (9) Check the md5sum and the signature. Let's release. (10) Upload the tarball, the md5sum and the signature to the website. (11) Write a release announcement to the mailing list. Preferably, the announcement should contain the MD5 hash generated above, and should be PGP-signed. It should include the URL for the tarball as well as the URL of the website. It should contain a brief summary of visible changes, as well as the URL of the webpage that would show a detailed list of changes. (12) Submit a release info to freshmeat.net. (13) Add a version tag to the VCS. (14) Change the version number in configure.ac: Increment it and add -dev to it. Run autoconf afterwards to propagate the change. Done. Enjoy the day. :-) masqmail-0.3.4/docs/howto-report-bugs0000644000000000000000000000270111705501561017747 0ustar00usergroup00000000000000Howto report bugs ================= All non-trivial software has bugs and so does masqmail. If you discover a bug then please report it. Your bug reports are an important help in improving masqmail. Valuable bug report include the following information. The first two are essential, the others can also be added on request. - A good description of what you consider to be the bug. - The version of masqmail that was used. (The output of: masqmail -bV). - A description on how to reproduce it. This includes information on other software that is involved. - The configuration files. These are probably the contents of /etc/masqmail/*. Don't forget to substitute confidential data with placeholders. - The relevant log files. Have a look at the value of use_syslog and log_dir in masqmail.conf. If use_syslog is enabled, the files are probably some of /var/log/mail*. If you don't use syslog, then the files reside unter the path assigned to log_dir, or by default in /var/log/masqmail/. Take care to substitute confidential data if you send debug files. (It's good to run masqmail with `-d 5' or `-d 6' to generate debugging data that may help to track down the bug. Report the bug to the mailing list . You don't have to be subscribed to write to the list. Please tell us if you're not subscribed so that we set you on CC. If you want to subscribe, send a mail with subject ``subscribe masqmail'' to . masqmail-0.3.4/docs/howto-static-linking0000644000000000000000000000111011705501561020407 0ustar00usergroup00000000000000Howto link masqmail statically? ------------------------------- With gcc (don't know anything about other compilers), you simply build masqmail with: LDFLAGS=-static make -e On Debian GNU/Linux, I received a bunch warnings of that kind: interface.o: In function `init_sockaddr': interface.c:55: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking On NetBSD I no warnings were printed. I don't have enough knowledge to tell the reasons and implications. Maybe you can. meillo masqmail-0.3.4/docs/oem-option0000644000000000000000000000567411705501561016442 0ustar00usergroup00000000000000-oem ==== This document explains what I found out about the -oem/-oee options. It is intended as a knowledge base for further development on this topic. In version 0.3.0 (2010-11), masqmail's implementation of -oem is considered broken and -oee is not implemented. Following is the behavior masqmail actually had: If -oi/-i is given, -oem is ignored. If no -oi/-i is given, always return with a non-zero return code. This current behavior is not like it should be. The desired behavior -------------------- It had been difficult to identify good explanations. The problem, as often, is that sendmail's source would be the definitive definition. But in which version and what if common behavior differs from sendmail's (maybe as a result of misunderstanding)? Exim's documentation has proven to be a valuable resource. In exim the behavior is such: If an error is detected while a non-SMTP message is being received (for example, a malformed address), the error is reported to the sender in a mail message. Exim exits with a non-zero return code then, no matter if the error message was successful or not. (In exim, -oee is similar but exim returns successful if the error message had been sent successful.) The mutt wiki writes about ``sendmail -oi -oem'': The mail server (in this case sendmail) will receive the message in input, and will parse it. In case of a malformed message, it will send an error message to the user to whom belongs the MUA trasmitting the message (e.g. user@localhost.localdomain), and it will exit with a non zero exit code: the -oem flag forces the returning of a non zero exit code even in the case the error message has been successfully sent to the local server. What does it mean for masqmail? ------------------------------- Masqmail does not send error messages on malformed addresses. It does not much check for syntax. It detects general errors (unexpected EOF, no recipients, max message size exceeded) (see masqmail.c:mode_accept()) but simply prints a message to stderr and exits non-zero. I think that currently it is not of need to add some elaborate error handling in this area. Hence, for the implementing of -oem and -oee would do assume that sending the error message does always fail (because we never send any such message) and hence we exit non-zero on error. This is the similar behavior of both options. From 0.3.1 on masqmail will not recognize -oem anymore and thus ignore it like any unknown -oXXX option. It's behavior is then as if error message sending fails. Remind that all this affects only the case of accepting non-SMTP messages on stdin. On the relationship of -oi and -oem ----------------------------------- It seems as if the two options should not affect each other; in contrast to the behavior in masqmail before 0.3.1. Their relationship is just that -oem does only affect non-SMTP messages on stdin, which is the typical use case of -oi. meillo masqmail-0.3.4/docs/ppp-setup0000644000000000000000000000407311705501561016301 0ustar00usergroup00000000000000This document covers dial-up internet connections with PPP ---------------------------------------------------------- Now you have to set up the online configuration. The trick is to tell your ip-up script the connection name. You could use the IP number of the far side of the ppp link, but this is a pain and may change each time. But you can give it an additional argument via pppd with ipparam. Somewhere in your dial up script you have a line similar to: /usr/sbin/pppd /dev/ttyS1 connect "/usr/sbin/chat -t 90 -f $CHATFILE" \ -d -d -d user user@somewhere file "$OPTIONS" Just add 'ipparam FastNet' in the command line for pppd if your ISP has the name FastNet. The ip-up script will then get 'FastNet' as a sixth parameter. In your ip-up script you can then call masqmail with /usr/local/sbin/masqmail -qo "$6" instead of 'sendmail -q', if you had that in the script before. Masqmail will then read the route configuration specified for the connection name 'FastNet' and deliver the mail destined to the internet. See the configuration manual on how to write a route configuration or use one of the examples as a template. I do not know how do configure that for an ISDN adapter, but I am sure you will find something similar in the man pages. If you want mail that is received by masqmail from your local net to be delivered immediately using the route configuration, you have two possibilities: * if you are using the masqdialer system, you just have to set online_query to something like /usr/bin/mservdetect localhost 224 if mserver is running on localhost and listens on port 224. See the man page to mservdetect(1). * otherwise you have to add two commands in your ip-up script: echo "$6" >/var/run/masqmail/masqmail-route chmod 644 /var/run/masqmail/masqmail-route and you have to remove the file /var/run/masqmail/masqmail-route in your ip-down script: rm /var/run/masqmail/masqmail-route Then you have to set online_query to /bin/cat /var/run/masqmail/masqmail-route See the route documentation for more. written by oku (it was once located inside of INSTALL) masqmail-0.3.4/docs/simple-local-setup0000644000000000000000000000420611705501561020061 0ustar00usergroup00000000000000Simple Setup ============ You want -------- - submit mail on stdin by calling masqmail on the commandline - submit mail with SMTP from the local machine - let masqmail deliver mail locally to the system mailboxes /var/mail/* You have luck, because this is what masqmail does by default. Set up ------ Follow the description in INSTALL. Most times it's simply: ./configure Configuration ------------- You just need a minimal config file, having one line: host_name = "foo.example.org" (Substitute a real value, of course.) Starting the daemon ------------------- Listening for SMTP connections on a port requires masqmail to run as daemon. You probably want to start masqmail as daemon each time the system comes up. How you have to do that is system dependent. /etc/rc.local is a good try to add the daemon call, because this file seems to be frequently available. /usr/local/sbin/masqmail -bd -q10m This starts masqmail in daemon mode and does a queue run every ten minutes. Check the setup --------------- Ensure you have the sendmail links correct: $ ls -l /usr/lib/sendmail /usr/sbin/sendmail lrwxrwxrwx 1 root root 25 2010-03-06 13:50 /usr/lib/sendmail -> /usr/local/sbin/masqmail* lrwxrwxrwx 1 root root 25 2010-03-06 13:50 /usr/sbin/sendmail -> /usr/local/sbin/masqmail* Send a mail to yourself: $ echo "some text" | mail `whoami` Check if the mail was delivered (then delete it and quit): $ mail Mail version 8.1.2 01/15/2001. Type ? for help. "/var/mail/meillo": 1 message 1 new >N 1 meillo@serveme.sc Wed Jul 14 22:50 13/467 & p Message 1: From Wed Jul 14 22:50:13 2010 Envelope-to: To: meillo From: Date: Wed, 14 Jul 2010 22:50:13 +0200 some text & d & q In case of problems ------------------- Have a look at the log file: /var/log/masqmail/masqmail.log Set the debug level in masqmail.conf, restart the daemon, redo the test, and look at the debug file: /var/log/masqmail/debug.log Ask on the mailing list: meillo masqmail-0.3.4/docs/simple-relay-setup0000644000000000000000000000617511705501561020112 0ustar00usergroup00000000000000Simple Setup ============ You want -------- - submit mail on stdin by calling masqmail on the commandline - submit mail with SMTP from the local machine - let masqmail deliver mail locally to the system mailboxes /var/mail/* - let masqmail forward non-local mail through a smart host This is like the simple-local-setup plus the forwarding. Set up ------ Follow the description in INSTALL. Most times it's simply: ./configure Configuration ------------- You need a config file like this one: host_name = "foo.example.org" query_routes.default = /etc/masqmail/default.route (Substitute a real hostname, of course.) Addionally you need to create the route config file like: # where to relay to; the address and port of the smart host mail_host = "mail.gmx.net:25" # use a wrapper to enable encryption # for STARTTLS on port 25: #instant_helo=true #wrapper="/usr/bin/openssl s_client -quiet -starttls smtp -connect mail.gmx.net:25 2>/dev/null" # for SMTP over SSL on port 465: #wrapper = "/usr/bin/openssl s_client -quiet -connect mail.gmx.net:465 2>/dev/null" do_correct_helo = true # rewrite the From addresses to ones visible from the outside map_return_path_addresses = "meillo: schnalke4@gmx.de" map_h_from_addresses = "meillo: markus schnalke " # it's good to use "login" only if the connection is encrypted auth_name = "login" #auth_name = "cram-md5" auth_login = "UID_OR_EMAIL_ADDRESS" auth_secret = "PASSWORD" Starting the daemon ------------------- Listening for SMTP connections on a port requires masqmail to run as daemon. You probably want to start masqmail as daemon each time the system comes up. How you have to do that is system dependent. /etc/rc.local is a good try to add the daemon call, because this file seems to be frequently available. /usr/local/sbin/masqmail -bd -q10m This starts masqmail in daemon mode and does a queue run every ten minutes. Check the setup --------------- Like in simple-local-setup plus ... Send a mail to a remote location: $ echo "some text" | mail foo@somewhereelse.example.org Check if it is queued: $ masqmail -bp Deliver it with: $ masqmail -qo default Check the queue contents again. You need to do such queue runs for online routes explicitely. For instance by cron. Automatic queue runs -------------------- You can also tell masqmail to send queued mails through a route each time the daemon does a queue run. Therefor you need to tell masqmail that it is online and can use the default route to deliver mail. Add this to masqmail.conf: online_query = "/bin/echo default" Now masqmail will send online mail automatically through the default route, each time it does a queue run (every ten minutes). In case of problems ------------------- Have a look at the log file: /var/log/masqmail/masqmail.log Set the debug level in masqmail.conf, restart the daemon, redo the test, and look at the debug file: /var/log/masqmail/debug.log If you use a wrapper, test it manually and interactively on the command line. Ask on the mailing list: meillo masqmail-0.3.4/docs/uucp-setup0000644000000000000000000000443311705501561016456 0ustar00usergroup00000000000000This document includes UUCP related information Note: My knowledge of UUCP setups is very poor. I hope that the provided information is correct. Improvements to this document are very welcome. --meillo UUCP setups call the MTA as `rmail'. Until version 0.2.23 masqmail could be called with this name. It switched to read-message-from-stdin mode then. AFAIK this is not enough to support UUCP, at least not at the level that is presumed by UUCP software. It seems as if at least the first input line should be handled special as it includes the envelope recipient. (Correct me if I'm wrong.) I discovered that exim has rmail support like this. That's probably the reason why it was the same in masqmail. A better, through still basic approach, was introduced with 0.2.24: misc/rmail is a small shell script (taken from postfix), which calls masqmail with appropriate options. Copy the script into your path and ensure that the included sendmail variable points to the masqmail executable. A more sophisticated rmail implementation seems to be available from sendmail. I don't know details about it and whether it is needed. The difference of sendmail's rmail implementation could be related to address rewriting (user@example.org <-> org!example!user). But I don't know details -- if you do, please let me know. UUCP makes use of the -f (set return path address, i.e. from whom the mail is) option of masqmail which is only permitted for user root, the trusted user (usually `mail'), and the trusted group (often group `mail'). UUCP, however, usually runs as user and group `uucp'. Masqmail currently supports only one trusted group and it is planned to remain so for simplicity reasons. (If you have good arguments on the case, try to convince me of the opposite.) Therefore the solution for masqmail is to add the user `uucp' to the trusted group (often group `mail'): usermod -G mail -a uucp This is not the perfect solution but an acceptable trade-off. If one really needs to enable user `uucp' to set -f but can not add it to the trusted group, see the comment in is_privileged_user() in permissions.c. It shows a hack which allows to trust another group, for instance the group `uucp'. See [1] for reasons why -f is important and needed. [1] http://bugs.hylafax.org/show_bug.cgi?id=842 meillo masqmail-0.3.4/examples/example.route0000644000000000000000000000572611705501561020030 0ustar00usergroup00000000000000# 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 envelope sender addresses, as they are # configured with your mail client. If not set, anybody may send. allowed_senders = "okurth" # local_hosts 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) denied_recipients = "*@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. # 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" masqmail-0.3.4/examples/localnet.route0000644000000000000000000000077111705501561020171 0ustar00usergroup00000000000000# Example route for a local network # see also: man 5 masqmail.route # # Include this route with # permanent_routes = "/etc/masqmail/localnet.route" # in masqmail.conf # adjust this to the machines on the local net allowed_recipients = "*@*mydomain.invalid;*@also.onlocal.net" # We expect the target hosts to be online. If not, fail. # Use this setting if you are sure the target hosts are online. connect_error_fail = true # If you don't want to query the DNS, uncomment: #resolve_list = "byname" masqmail-0.3.4/examples/masqmail.conf0000644000000000000000000000213511705501561017757 0ustar00usergroup00000000000000# masqmail.conf # Example configuration for masqmail # The name with which masqmail identifies itself to others: # CHANGING THIS IS REQUIRED! host_name="striped.patchwork.net" # accept connections on these interfaces: # Change this to something like: "localhost:25;foo:25" if other machines # on your network shall be able to connect to masqmail. #listen_addresses="localhost:25" # use syslogd for logs? #use_syslog=false # online detection: # # for 'file' uncomment next 2 lines #online_query = "/bin/cat /var/run/masqmail/masqmail-route" # example for local delivery to an mda: # #mbox_default=mda #mda="/usr/bin/procmail -Y -d ${rcpt_local}" # alias expansion: # #alias_file = "/etc/aliases" #caseless_matching = false # routes # CHANGING THIS IS REQUIRED! # set up a route for the local net: #permanent_routes = "/etc/masqmail/localnet.route" # You can use as many routes (one for each provider) as you like: #query_routes.example = "/etc/masqmail/example.route" # you can also give a list of routes for a single connection: #query_routes.foobar = "/etc/masqmail/foo.route;/etc/masqmail/bar.route" masqmail-0.3.4/examples/openssl.route0000644000000000000000000000142611705501561020051 0ustar00usergroup00000000000000# openssl.route # by Philipp Berndt # encryption is done by communicating through openssl # Today usually STARTTLS (RFC-3207) is used: # don't forget the instant_helo, otherwise it won't work, # because the wrapper eats the 220 greeting instant_helo=true wrapper="/usr/bin/openssl s_client -quiet -starttls smtp -connect mail.gmx.net:25 2>/dev/null" # The old way is SMTP over SSL; the IETF had marked it obsolete: # don't use instant_helo here #wrapper="/usr/bin/openssl s_client -quiet -connect mail.gmx.net:465 2>/dev/null" # which sender addresses are allowed for this route? allowed_senders = "*@gmx.de;*@gmx.net" # the authentication method #auth_name = "cram-md5" auth_name = "login" # user name und password auth_login = "UID_OR_EMAIL_ADDRESS" auth_secret = "YOUR_PASSWORD" masqmail-0.3.4/install-sh0000755000000000000000000001273611705501561015502 0ustar00usergroup00000000000000#!/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 masqmail-0.3.4/man/Makefile.am0000644000000000000000000000013611705501561016274 0ustar00usergroup00000000000000man_MANS=masqmail.8 mservdetect.1 masqmail.conf.5 masqmail.route.5 masqmail.aliases.5 rmail.8 masqmail-0.3.4/man/Makefile.in0000644000000000000000000003725611705501561016322 0ustar00usergroup00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = man DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man8dir)" man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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@ GREP = @GREP@ INSTALL = @INSTALL@ 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@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RESOLV_LIBS = @RESOLV_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ 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.1 masqmail.conf.5 masqmail.route.5 masqmail.aliases.5 rmail.8 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } install-man5: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list=''; test -n "$(man5dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } install-man8: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list=''; test -n "$(man8dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-man uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man5 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-man \ uninstall-man1 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: masqmail-0.3.4/man/README0000644000000000000000000000020011705501561015110 0ustar00usergroup00000000000000Since masqmail-0.2.22, documentation is maintained in troff (man page) format directly. The old XML sources are no longer used. masqmail-0.3.4/man/masqmail.80000644000000000000000000002527611705501561016151 0ustar00usergroup00000000000000.TH masqmail 8 2012-01-18 masqmail-0.3.4 "Maintenance Commands" .SH NAME masqmail \- An offline Mail Transfer Agent .SH SYNOPSIS .BR masqmail\ [ \-t ] \ [ \-oi ] \ [ \-f\ \fIADDRESS ]\ \fIRECIPIENT... .B mailq .br .B masqmail \-bp .B runq .br .B masqmail \-q .BR masqmail\ \-qo\ \fINAME .BI mailrm\ MSGID... .br .BI masqmail\ -Mrm\ MSGID... .BR masqmail\ [ \-C\ \fIFILE ] \ [ \-odq ]\ \-bs .BR masqmail\ [ \-C\ \fIFILE ] \ [ \-odq ]\ \-bd\ \-q\fIINTERVAL (This list is a selection.) .SH DESCRIPTION Masqmail is a mail server designed for hosts that do not have a permanent internet connection e.g. 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. .SH OPERATION MODES Masqmail operates in one of several exclusive modes. The daemon mode has two flavors that may be, and usually are, used in combination: .TP .B Daemon (listen) .B \-bd or invoked as .B smtpd Run as daemon. Act as SMTP server and accept SMTP connections, on port 25 if not configured differently. This is normally used in the startup script at system boot and together with \fB\-q\fIINTERVAL\fR (see below). Alternatively masqmail can be run with the \fB\-bs\fR option from inetd. .TP .B Daemon (queue) .B \-q\fIINTERVAL Run as daemon. Do regular queue runs at the specified time interval. This is normally used together with \fB\-bd\fR (see above). An argument may be a time interval i.e. 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: \fB\-q30m\fR. Combinations like \fB\-q1h30m\fR, which sendmail accepts, are not possible. Alternatively single queue runs (\fB\-q\fR) can be started from cron. .P The queue processing mode has two flavors that may be used in combination: .TP .B Single queue run (normal) .B \-q (without argument) or invoked as .B runq Do a single queue run. Try to deliver all messages in the queue. Masqmail sends to addresses on the local host and to remote ones, if available online routes permit it. That means, masqmail sends all queued mail it can. Online detection is done with the configured method (see \fBonline_query\fR in \fBmasqmail.conf(5)\fR). .TP .B Single queue run (only named route) .BI \-qo\ NAME Do a single queue run and deliver only using the specified online route. The route configuration for \fINAME\fP is read and queued mail to matching remote recipients is sent. (See \fBquery_routes.\fINAME\fR in the main config file.) You may want to use this option in scripts that run as soon as a link to the internet has been set up (e.g. ip-up). .B Obsolete behavior: Up to now: If .B \-qo has no argument, the online connection is determinded by online detect and, if available, mail is sent through it. If none is available no mail is delivered. This behavior is likely to change in future versions because it is included in \-q. We could do something more useful instead. .P The other modes are simple ones: .TP .B Rebuild alias database .B \-bi or invoked as .B newaliases A no-op for masqmail, just exit. Old sendmail rebuilds its alias database when invoked with this option. Masqmail reads directly from its alias file (see config option `alias_file'), thus no database needs to be updated. .TP .B Accept messages .BR \-bm , also the default mode Accept a text message on stdin. This is the default mode of operation. One will hardly use this switch as it is the default. The command line options .BR \-f , \-F , \-i / \-oi , \-t are only used in this mode. .TP .B Print queue .B \-bp or invoked as .B mailq Show the messages in the queue. .TP .B Stand-alone SMTP server .B \-bs Act as SMTP server by reading commands from stdin and writing to stdout. Some mailers (e.g. pine) use this option as an interface. It can also be used to call masqmail from inetd. .TP .B Print version .B \-bV or if called without arguments Print version information, then exit. .TP .B Queue manipulation mode .B \-Mrm or invoked as .B mailrm Remove given messages from the queue. Privileged users may remove any message, other users only their own. The message identifiers are listed when printing the queue (see \fB\-bp\fR). .P The default mode: .P When no mode had been specified by either one of the above command line options or by calling masqmail under a special name, then the default mode \fB\-bm\fR (i.e. accept messages on stdin) is entered. However, if neither address arguments are specified nor \fB\-t\fR is given, then mail can not be sent, hence something more useful is done: \fB\-bV\fP is assumed. .SH OPTIONS Since masqmail is intended to replace sendmail, it uses the same command line options, but not all are implemented. The \fB\-qo\fP option is additional, and unique to masqmail. .TP \fB\-\-\fR 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\fR ``Daemon (listen)'' mode. See above. .TP \fB\-bi\fR ``Rebuild alias database'' mode. See above. .TP .B \-bm ``Accept message'' mode. See above. .TP \fB\-bp\fR ``Print queue'' mode. See above. .TP \fB\-bs\fR ``Stand-alone SMTP server'' mode. See above. .TP \fB\-bV \fR ``Print version'' mode. See above. .TP \fB\-B \fIarg\fR \fIarg\fR 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\-C \fIfilename\fR Use another configuration than \fI/etc/masqmail/masqmail.conf\fR. Useful for debugging purposes. If not invoked by a privileged user, masqmail will drop all privileges. .TP \fB\-d \fInumber\fR Set the debug level. This takes precedence before the value of `debug_level' in the configuration file. Read the warning in the description of the latter. Only root may set the debug level. .TP \fB\-f [\fIaddress\fB]\fR Set the return path address to \fIaddress\fR. Only root, the user mail and anyone in group mail is allowed to do that. .TP \fB\-F [\fIstring\fB]\fR Set the full sender name (in the From: header) to \fIstring\fR. .TP \fB\-i\fR Same as \fB\-oi\fR, see below. Kept for compatibility. .TP \fB\-Mrm \fImsgid...\fR ``Queue manipulation'' mode. See above. .TP \fB\-m\fR ``Me too'' This switch is ignored as, masqmail never excludes the sender from any alias expansions. \fB\-m\fP is an ancient alias for \fB\-om\fP. Kept for compatibility. .TP \fB\-odb\fR ``Deliver in Background'' Masqmail always does this. Hence masqmail ignores this switch. .TP \fB\-odq\fR ``Do Queueing'' 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 (but global) effect by setting the do_queue option in /etc/masqmail/masqmail.conf. .TP \fB\-oi\fR A dot as a single character in a line does not terminate the message. The same as \fB\-i\fP. .TP \fB\-oXXX\fR Any other switch starting with `\-o' is ignored. This especially affects \-om, \-oem, \-oee. .TP \fB\-q ``Single queue run (normal)'' mode. See above. .TP \fB\-q\fIINTERVAL ``Daemon (queue)'' mode. See above. .TP \fB\-qo \fIname ``Single queue run (only named route)'' mode. See above. .TP \fB\-t\fR Read recipients from mail headers and add them to the ones specified on the command line. (Only To:, Cc:, and Bcc: headers are regarded.) .B WARNING: The behavior changed with version 0.3.1! In earlier versions command line argument addresses were ``substracted'' from header addresses. The old behavior was similar to exim's and smail's (which are anchesters of masqmail). The new behavior is similar to the one of current postfix versions, which add the arguments to the set of header recipients. (Earlier postfix failed in case of address arguments with \-t.) Sendmail seems to behave differently, depending on the version. See exim(8) for further information. For masqmail the most simple approach had been taken. As the behavior of \-t together with command line address arguments differs among MTAs, one better not steps into this corner case. .TP \fB\-v\fR ``Verbose'' 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 \(en the return path. SENDER_DOMAIN \(en the domain part of the return path. SENDER_LOCAL \(en the local part of the return path. RECEIVED_HOST \(en the host the message was received from (unless local). LOCAL_PART, USER, LOGNAME \(en the local part of the (original) recipient. MESSAGE_ID \(en the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header. QUALIFY_DOMAIN \(en the domain which will be appended to unqualified addresses. .SH FILES .TP .I /etc/masqmail/masqmail.conf The main configuration for masqmail. Depending on the settings in this file, you will also have other configuration files in \fI/etc/masqmail/\fR. .TP .I /var/spool/masqmail/ The spool directory where masqmail stores its queued mails. .TP .I /var/spool/mail/ The directory where locally delivered mail will be put, if not configured differently in \fImasqmail.conf\fR. .TP .I /var/log/masqmail/ The directory where masqmail stores its log messages. .P Any of the paths can be configured at compile time, and (except the main config file) also in the main config file. The typical paths are different, depending on the Unix system you use. .SH CONFORMING TO RFC 821, 822, 1869, 1870, 2197, 2554 (SMTP) RFC 1321 (MD5) RFC 2195 (CRAM-MD5) .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail on its website: .BR http://marmaro.de/prog/masqmail/ . There is also a mailing list; you will find information about it on the website. .SH BUGS Bug reports of any kind are very welcome. They help masqmail to become better. Please report bugs to the mailing list (anyone can post). .SH SEE ALSO \fBmasqmail.conf(5)\fR, \fBmasqmail.route(5)\fR, \fBmasqmail.aliases(5)\fR masqmail-0.3.4/man/masqmail.aliases.50000644000000000000000000000362111705501561017554 0ustar00usergroup00000000000000.TH masqmail.aliases 5 2012-01-18 masqmail-0.3.4 "File Formats" .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\fR. .SH FILE FORMAT The alias file consists of lines of the form: local_part: item1, item2, ... Items can be surrounded by double quotes `"'. If within the quotes other quotes are needed for an address they can be escaped with a leading backslash `\\'. A leading backslash `\\' 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 the 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 EXAMPLE .nf # postmaster is required by RFC 2821 postmaster: root # forward abuse mail to another address abuse: abuse@example.org # copy root's mail also to meillo root: \\root, meillo # pass mail to a script foo: |/usr/bin/foo .fi .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR. There is also a mailing list, you will find information about it at masqmail's main site. .SH BUGS Please report bugs to the mailing list. .SH SEE ALSO \fBmasqmail.conf(5)\fR, \fBmasqmail(8)\fR, masqmail-0.3.4/man/masqmail.conf.50000644000000000000000000004066311705501561017067 0ustar00usergroup00000000000000.TH masqmail.conf 5 2012-01-18 masqmail-0.3.4 "File Formats" .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\fR The configuration consists of lines of the form \fBval\fR = \fIexpression\fR Where \fBval\fR is a variable name and \fIexpression\fR a string, which can be quoted with double quotes `"'. 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 \fBval\fP 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 semicolons `;'. For some values, patterns (like `*',`?') can be used. The spaces in front of and after the equal sign `=' are optional. Most lists (exceptions: \fBlocal_hosts\fR, \fBlisten_addresses\fR, \fBquery_routes.\fIname\fR and \fBpermanent_routes\fR) 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 the entries are 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 a hash `#' are ignored. .SH OPTIONS .TP \fBrun_as_user = \fIboolean\fR 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\fR If this is set, masqmail uses syslogd for logging. It uses facility MAIL. You still have to set \fBlog_dir\fR for debug files. .TP \fBdebug_level = \fIn\fR Set the debug level. Valid values are 0 to 6 and 9. Be careful if you set this as high as 5 or higher, the logs may very soon fill your hard drive. Level 9 enables printing of debug messages to stderr during reading of the config file. The debug file comes available for the first time after this step. Thus nothing but stderr is available. Level 9 is almost never interesting. .TP \fBlog_dir = \fIfile\fR The directory where logs are stored, if syslog is not used. Debug files are always stored in this directory if debugging is enabled. \fIfile\fR must be an absolute path. Default: \fI/var/log/masqmail\fR .TP \fBmail_dir = \fIfile\fR The directory where local mail is stored, usually \fI/var/spool/mail\fR or \fI/var/mail\fR. \fIfile\fR must be an absolute path. Default: \fI/var/mail\fR .TP \fBspool_dir = \fIfile\fR The directory where masqmail stores its spool files (and later also other stuff). It must have a subdirectory \fIinput\fR. Masqmail needs read and write permissions for this directory. \fIfile\fR must be an absolute path. Default: \fI/var/spool/masqmail\fR .TP \fBlock_dir = \fIfile\fR The directory where masqmail stores its lock files. Masqmail needs read and write permissions for this directory. By default it is a directory ``lock'' inside of \fIspool_dir\fP. \fIfile\fR must be an absolute path. .TP \fBhost_name = \fIstring\fR 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\fR for that. Default: none; \fBhost_name\fP MUST be set in the config file .TP \fBlocal_hosts = \fIlist\fR A semicolon `;' separated list of hostnames which are considered local. Can contain glob patterns, like `*example.org' or `mail?.*mydomain.net'. Normally you should set it to "localhost;foo;foo.bar.com" if your host has the fully qualified domain name `foo.bar.com'. Default: localhost ; ; Example: \fIlocalhost;foo;foo.example.org\fR (if you have set \fBhost_name\fR to \fIfoo.example.org\fR) .TP \fBlocal_addresses = \fIlist\fR 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\fR. This list can be seen as an addition to \fBlocal_hosts\fP. Further more only the local part of the addresses will be regarded, seeing it as a local user. Example: \fIlocal_addresses = "person1@yourdomain;person2@yourdomain"\fP This means mail to person1@yourdomain will effectively go to person1@localhost, if not redirected by an alias. .TP \fBnot_local_addresses = \fIlist\fR 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\fR. This list can be seen as a substraction to \fBlocal_hosts\fP. This is 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\fR 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 addresses. If your host has different names which resolve to the same IP, use only one of them, otherwise you will get an error message. Default: \fIlocalhost:25\fR (i.e. only local processes can connect) .TP \fBdo_save_envelope_to = \fIboolean\fR 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 fetchmail, and the server supports Envelope-to: headers, and you want to make use of those with a mail filtering tool, e.g. procmail. It cannot be preserved because masqmail sets such a header by itself. Default is false. .TP \fBdo_relay = \fIboolean\fR 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\fR If this is set, masqmail will not try to deliver mail immediately when accepted. Instead it will always queue it. (Note: Masqmail will always automatically queue mail if neccesary, i.e. if it cannot deliver because no suitable route was available for example.) Same as calling masqmail with the \fB\-odq\fR option. Usually you should leave this option unset. Default: false .TP \fBpermanent_routes\fR = \fIlist\fR Set this to the filename (or a semicolon-separated list of filenames) of the route configuration for always available connections. Main purpose is to define a mail server with mail_host in your local network, or if masqmail should send mail directly to the target host. If you have only a single host, you can leave it unset. A setting `\fBlocal_nets\fR = \fI"*home.net"\fR' in versions <= 0.3.3 is in newer versions configured as: `\fBpermanent_routes\fR = \fI"/etc/masqmail/homenet.route"\fR' and the route file `homenet.route' containing: .in +1in .nf allowed_recipients = "*@*home.net" connect_error_fail = true resolve_list = byname .fi .in 0 This is just as it had been with \fBlocal_net_route\fP, with the exception that the filtering for appropriate addresses is only in the route file and not with \fBlocal_nets\fR. .TP \fBquery_routes.\fIname\fR = \fIlist\fR Replace \fIname\fR with a name to identify the connection. Set this to a filename (or a semicolon-separated list of filenames) for the route configuration for that connection. Routes of this kind cannot be expected to be online always. Masqmail will query which of the routes are online. You can use the name to call masqmail with the \fB\-qo\fR option every time a connection to your ISP is set up, in order to send queued mail through this route. Example: Your ISP has the name FastNet. Then you write the following line in the main configuration: \fBquery_routes.\fBFastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR \fI/etc/masqmail/fastnet.route\fR is the route configuration file, see \fBmasqmail.route(5)\fR. As soon as a link to FastNet has been set up, you call `masqmail \fB\-qo \fIFastNet\fR'. Masqmail will then read the specified file and send the mails. See \fBonline_query\fP. .TP \fBalias_file = \fIfile\fR Set this to the location of your alias file. If not set, no aliasing will be done. Default: (i.e. no aliasing is done) .TP \fBcaseless_matching = \fIboolean\fR If this is set, aliasing and the matching for \fBlocal_addresses\fP and \fBnot_local_addresses\fP will be done caseless. Note: Be sure to change this option only if the queue is empty as correct processing of queued messages is not guaranteed otherwise. Default: false .TP \fBpipe_fromline = \fIboolean\fR 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\fR 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\fR above. Default is false. .TP \fBmbox_default = \fIstring\fR The default local delivery method. Can be mbox or mda. You can override this for each user by using the \fBmbox_users\fR or \fBmda_users\fR (see below). Default: mbox. .TP \fBmbox_users = \fIlist\fR A list of users which wish delivery to an mbox style mail folder. .TP \fBmda_users = \fIlist\fR A list of users which wish local delivery to an mda. You have to set \fBmda\fR (see below) as well. .TP \fBmda = \fIexpand string\fR 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 dolloar 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 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)\fR. To use environment variables for the mda, the dollar sign `$' has to be escaped with a backslash, otherwise they will be tried to be expanded with the internal variables. .TP \fBmda_fromline = \fIboolean\fR 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\fR 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\fR above. Default is false. .TP \fBonline_query = \fIcommand line\fR Defines the method masqmail uses to detect whether there exists an online connection currently. Masqmail executes the command given and reads from its standard output. The command should just print a route name, as defined with \fBquery_routes.\fIname\fR, to standard output and return a zero status code. Masqmail assumes it is offline if the script returns with a non-zero status. Leading and trailing whitespace is removed from the output. Simple example: .nf #!/bin/sh test \-e /var/run/masqmail/masqmail-route || exit 1 cat /var/run/masqmail/masqmail-route exit 0 .fi No matter how masqmail detects the online status, only messages that are accepted at online time will be delivered using the connection. The mail spool still needs to be emptied manually (\fB\-qo\fIconnection\fR). \fIcommand line\fR must start with an absolute path to an executable program. It can contain optional arguments. To simulate the old online_method=file, use: \fI/bin/cat /path/to/file\fP To be always online with connection `foo', use: \fI/bin/echo foo\fP To query a masqdialer server (i.e. asking it whether a connection exists and what its name is) use: \fI/usr/bin/mservdetect localhost 224\fP .TP \fBerrmsg_file = \fIfile\fR 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\fR 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\fR Set this to a template which will be used to generate delivery warning reports. It uses the same mechanisms for variables as \fBerrmsg_file\fR, see above. Default is /usr/share/masqmail/tpl/warnmsg.tpl. .TP \fBwarn_intervals\fR = \fIlist\fR 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\fR = \fItime\fR 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\fR Replace \fIname\fR with a valid local or remote mail address. If this option is set, then a copy of every mail, that passes through 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 .TP \fBmax_msg_size\fR = \fIbytes\fR This option sets the maximum size in bytes masqmail will accept for delivery. This value is advertised to the SMTP client by the `SIZE' message during SMTP session setup. Clients pretending to send, or actually send, more than \fIbytes\fR will get a 552 error message. `0' means no fixed maximum size limit is in force. Default is 0 (= unlimited). .TP \fBdefer_all\fR = \fIboolean\fR If set to true, masqmail replies with ``421 service temporarily unavailable'' to any SMTP request and shuts the connection down. Note: This option is for debugging purposes only. Default: false .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR. There is also a mailing list, you will find information about it at masqmail's main site. .SH BUGS Please report bugs to the mailing list. .SH SEE ALSO \fBmasqmail(8)\fR, \fBmasqmail.route(5)\fR masqmail-0.3.4/man/masqmail.route.50000644000000000000000000002736411705501561017303 0ustar00usergroup00000000000000.TH masqmail.route 5 2012-01-18 masqmail-0.3.4 "File Formats" .SH NAME masqmail.route \- masqmail route configuration file .SH DESCRIPTION This man page describes the syntax of the route configuration files of \fBmasqmail (8)\fR. Their usual locations are in \fI/etc/masqmail/\fR. Mail will be sent with the SMTP protocol to its destination, unless `pipe' is given. In this case the message will be piped to the given program. .SH ROUTE CONDITIONS .TP \fBallowed_senders\fR = \fIlist\fR This is a semicolon `;' separated list of envelope sender addresses. Messages which have one of these addresses as the return path (= mail from) are allowed to use this route (if not also in \fBdenied_senders\fR). Glob patterns containing `?' and `*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications). If the pattern doesn't contain an `@', it is seen as a pattern for the local part only. Example: \fImeillo;*@*example.org;web*@example.com\fP (``meillo'' equals ``meillo@*'', i.e. the local part.) .TP \fBdenied_senders\fR = \fIlist\fR This is a semicolon `;' separated list of envelope sender addresses. Messages which have one of these addresses as the return path (= mail from) will not be sent using this route (even if also in \fBallowed_senders\fR). Glob patterns containing `?' and `*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications). If the pattern doesn't contain an `@', it is seen as a pattern for the local part only. Example: (see \fIallowed_senders\fP) .TP \fBallowed_recipients\fR = \fIlist\fR A list of envelope recipient addresses where mail can be sent to using this route. This is for example useful if you use this route configuration when connected to another LAN via ppp. Glob patterns containing `?' and `*' can be used. Example: \fI*@example.org;*@*foo.bar\fP (See also examples for \fIallowed_senders\fP) .TP \fBdenied_recipients\fR = \fIlist\fR A list of envelope recipient addresses where mail will not be sent to using this route. This is for example useful if you send mail directly (\fBmail_host\fR 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/\fR). \fBdenied_recipients\fR overrules \fBallowed_recipients\fR. Glob patterns containing `?' and `*' can be used. Example: \fI*@spamblocker.example.org\fP (See also examples for \fIallowed_senders\fP) .TP \fBlast_route\fR = \fIboolean\fR 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_recipients' and `allowed_senders' or their complements (denied_), 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 \fBconnect_error_fail\fR = \fIboolean\fR If this is set, a connection error (or if a pipe command could not be executed) 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. You probably want to set this to true for permanent routes. .SH SMTP CONFIGURATION .TP \fBmail_host\fR = \fIstring\fR 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\fR = \fIlist\fR 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)\fR will be used. For routes to a local network, where you likely don't have a DNS service, use only `byname'. The default is "dns_mx;dns_a;byname". .TP \fBhelo_name\fR = \fIstring\fR Set the name given with the HELO/EHLO command. If this is not set, \fBhost_name\fR from \fImasqmail.conf\fR will be used, if the \fBdo_correct_helo\fR option (see below) is unset. .TP \fBdo_correct_helo\fR = \fIboolean\fR 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\fR from \fImasqmail.conf\fR or as given with the \fBhelo_name\fR (see above) will be used. .TP \fBinstant_helo\fR = \fIboolean\fR If this is set, masqmail does not wait for the greeting of the SMTP server after opening the connection. Instead it says EHLO right away (ESMTP is assumed). Use this option with wrappers that eat the 220 greeting of the SMTP server. Common examples are STARTTLS wrappers, like `openssl s_client \-starttls smtp ...'. If this option is set and a 220 greeting is received though, everything should still work. Please don't rely on that and keep in mind that RFC 2821 says that the client SHOULD wait for the 220 greeting of the server. Default: false .TP \fBdo_pipelining\fR = \fIboolean\fR 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 \fBauth_name\fR = \fIstring\fR Set the authentication type for ESMTP AUTH authentication. Currently only `cram-md5' and `login' are supported. .TP \fBauth_login\fR = \fIstring\fR Your account name for ESMTP AUTH authentication. .TP \fBauth_secret\fR = \fIstring\fR Your secret for ESMTP AUTH authentication. .TP \fBwrapper\fR = \fIcommand\fR If set, instead of opening a connection to a remote server, \fIcommand\fR 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 SMTP over SSL tunneling: .nf wrapper="/usr/bin/openssl s_client \-quiet \-connect mail.gmx.net:465 2>/dev/null" .fi SMTP over SSL is supported since masqmail-0.1.8. It is marked obsolete by the IETF but is still in use. Example for encryption with STARTTLS (RFC-3207): .nf # don't forget the instant_helo, otherwise it won't work instant_helo=true wrapper="/usr/bin/openssl s_client \-quiet \-starttls smtp \-connect mail.gmx.net:25 2>/dev/null" .fi This is supported since masqmail-0.2.28. STARTTLS supersedes SMTP over SSL. Note for openssl: Ensure that stderr is redirected. Do *not* use \-crlf in the wrapper command, because masqmail does already insert CRLF. However, you might want to specify \-crlf if you want to test your wrapper command interactively on the command line. .SH PIPE CONFIGURATION .TP \fBpipe\fR = \fIcommand\fR \fIcommand\fR 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)\fR. .TP \fBpipe_fromline = \fIboolean\fR Only if `pipe' is used. A from line will be prepended to the output stream whenever a pipe command is called. Default is false. .TP \fBpipe_fromhack = \fIboolean\fR Only if `pipe' is used. 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\fR above. Default is false. .SH ADDRESS REWRITE RULES .TP \fBset_h_from_domain\fR = \fIstring\fR 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 address on the internet. Note that this is different to \fBset_return_path_domain\fR, see below. .TP \fBset_h_reply_to_domain\fR = \fIstring\fR Same as \fBset_h_from_domain\fP, but for the `Reply-To' header. .TP \fBset_return_path_domain\fR = \fIstring\fR 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\fR for rewriting local parts. .TP \fBmap_h_from_addresses\fR = \fIlist\fR This is similar to \fBset_h_from_domain\fR, 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: .nf map_h_from_addresses = "john: John Smith ; charlie: Charlie Miller " .fi You can use patterns, eg. * as keys. .TP \fBmap_h_reply_to_addresses\fR = \fIlist\fR Same as \fBmap_h_from_addresses\fR, but for the `Reply-To:' header. .TP \fBmap_h_mail_followup_to_addresses\fR = \fIlist\fR Same as \fBmap_h_from_addresses\fR, but for the `Mail-Followup-To:' header. Useful when replying to mailing lists. .TP \fBmap_return_path_addresses\fR = \fIlist\fR This is similar to \fBset_return_path_domain\fR, 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\fR takes RFC 822 addresses. The most important difference is that RFC 821 addresses have no full name. Example: .nf map_return_path_addresses = "john: ; charlie: " .fi You can use patterns, eg. * as keys. .TP \fBexpand_h_sender_address\fR = \fIboolean\fR 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\fR or \fBmap_return_path_addresses\fR). 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)\fR 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\fR = \fIboolean\fR Like \fBexpand_h_sender_address\fR, but sets the domain only. Deprecated, will be removed in a later version. .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR. There is also a mailing list, you will find information about it at masqmail's main site. .SH BUGS Please report bugs to the mailing list. .SH SEE ALSO \fBmasqmail(8)\fR, \fBmasqmail.conf(5)\fR masqmail-0.3.4/man/mservdetect.10000644000000000000000000000215711705501561016654 0ustar00usergroup00000000000000.TH mservdetect 1 2012-01-18 masqmail-0.3.4 "User Commands" .SH NAME mservdetect \- Helper for masqmail in combination with masqdialer .SH SYNOPSIS \fB/usr/bin/mservdetect \fIhost port\fR .SH DESCRIPTION Mservdetect is a small helper application for masqmail to detect its online status through the modem server masqdialer. It connects to \fIhost\fR at \fIport\fR, speaking the masqdialer protocol, and finally prints the active connection name, if any, to stdout. If you want to use it, set \fBonline_query\fR=\fI"/usr/bin/mservdetect host port"\fR in masqmail.conf. .SH OPTIONS .TP \fBhost\fR The hostname where the masqdialer server is running. .TP \fBport\fR The port number where the masqdialer server is listening. .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR. There is also a mailing list, you will find information about it at masqmail's main site. .SH BUGS Please report bugs to the mailing list. .SH SEE ALSO \fBmasqmail(8)\fR, \fBmasqmail.conf(5)\fR masqmail-0.3.4/man/rmail.80000644000000000000000000000236011705501561015436 0ustar00usergroup00000000000000.TH rmail 8 2012-01-18 masqmail-0.3.4 "Maintenance Commands" .SH NAME rmail \- handle remote mail received via uucp .SH SYNOPSIS \fB/usr/sbin/rmail \fIrecipient ...\fR .SH DESCRIPTION Rmail is a wrapper around masqmail. It reads a mail message on standard input and passes it to masqmail's standard input. Rmail only removes the first line from the input and constructs the return path from it. Such a first line: From user Wed Jan 9 12:43:35 1985 remote from host Date: 9 Jan 1985 8:39 EST would generate this call to masqmail: masqmail \-i \-f user@host \-\- bob@example.org (If ``bob@example.org'' was the argument to the rmail call.)) .SH AUTHOR Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke . You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR. There is also a mailing list, you will find information about it at masqmail's main site. This man page was written by markus schnalke .SH BUGS Address translations from domain!user to user@domain is not done. This rmail program is only very basic. See sendmail for a more sophisticated rmail implementation. Please report bugs to the mailing list. .SH SEE ALSO \fBmasqmail(8)\fR masqmail-0.3.4/missing0000755000000000000000000002403211705501561015065 0ustar00usergroup00000000000000#! /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 masqmail-0.3.4/mkinstalldirs0000755000000000000000000000133011705501561016270 0ustar00usergroup00000000000000#! /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 masqmail-0.3.4/src/Makefile.am0000644000000000000000000000241611705501561016313 0ustar00usergroup00000000000000SUBDIRS=base64 md5 AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED sbin_PROGRAMS=masqmail bin_PROGRAMS=mservdetect noinst_PROGRAMS=smtpsend readtest resolvtest masqmail_SOURCES=\ dotlock.h\ masqmail.h\ readsock.h\ smtp_out.h\ lookup.h\ accept.c\ address.c\ alias.c\ child.c\ connect.c\ conf.c\ deliver.c\ dotlock.c\ expand.c\ fail_msg.c\ header.c\ interface.c\ local.c\ log.c\ listen.c\ lookup.c\ masqmail.c\ message.c\ online.c\ parse.c\ peopen.c\ peopen.h\ permissions.c\ 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\ mservdetect.c\ readsock.c\ peopen.c readtest_SOURCES=\ readsock.c\ readsock.h\ readtest.c resolvtest_SOURCES=\ resolvtest.c\ lookup.c masqmail_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ smtpsend_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ mservdetect_LDADD=@GLIB_LIBS@ readtest_LDADD=@GLIB_LIBS@ resolvtest_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ masqmail-0.3.4/src/Makefile.in0000644000000000000000000006564511705501561016341 0ustar00usergroup00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : sbin_PROGRAMS = masqmail$(EXEEXT) bin_PROGRAMS = mservdetect$(EXEEXT) noinst_PROGRAMS = smtpsend$(EXEEXT) readtest$(EXEEXT) \ resolvtest$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" 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) header.$(OBJEXT) \ interface.$(OBJEXT) local.$(OBJEXT) log.$(OBJEXT) \ listen.$(OBJEXT) lookup.$(OBJEXT) masqmail.$(OBJEXT) \ message.$(OBJEXT) online.$(OBJEXT) parse.$(OBJEXT) \ peopen.$(OBJEXT) permissions.$(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 = am_mservdetect_OBJECTS = mservdetect.$(OBJEXT) readsock.$(OBJEXT) \ peopen.$(OBJEXT) mservdetect_OBJECTS = $(am_mservdetect_OBJECTS) mservdetect_DEPENDENCIES = am_readtest_OBJECTS = readsock.$(OBJEXT) readtest.$(OBJEXT) readtest_OBJECTS = $(am_readtest_OBJECTS) readtest_DEPENDENCIES = am_resolvtest_OBJECTS = resolvtest.$(OBJEXT) lookup.$(OBJEXT) resolvtest_OBJECTS = $(am_resolvtest_OBJECTS) resolvtest_DEPENDENCIES = 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 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) \ $(readtest_SOURCES) $(resolvtest_SOURCES) $(smtpsend_SOURCES) DIST_SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) \ $(readtest_SOURCES) $(resolvtest_SOURCES) $(smtpsend_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ 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@ GREP = @GREP@ INSTALL = @INSTALL@ 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@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RESOLV_LIBS = @RESOLV_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_confdir = @with_confdir@ with_group = @with_group@ with_logdir = @with_logdir@ with_spooldir = @with_spooldir@ with_user = @with_user@ SUBDIRS = base64 md5 AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED masqmail_SOURCES = \ dotlock.h\ masqmail.h\ readsock.h\ smtp_out.h\ lookup.h\ accept.c\ address.c\ alias.c\ child.c\ connect.c\ conf.c\ deliver.c\ dotlock.c\ expand.c\ fail_msg.c\ header.c\ interface.c\ local.c\ log.c\ listen.c\ lookup.c\ masqmail.c\ message.c\ online.c\ parse.c\ peopen.c\ peopen.h\ permissions.c\ 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\ mservdetect.c\ readsock.c\ peopen.c readtest_SOURCES = \ readsock.c\ readsock.h\ readtest.c resolvtest_SOURCES = \ resolvtest.c\ lookup.c masqmail_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ smtpsend_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ mservdetect_LDADD = @GLIB_LIBS@ readtest_LDADD = @GLIB_LIBS@ resolvtest_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) masqmail$(EXEEXT): $(masqmail_OBJECTS) $(masqmail_DEPENDENCIES) @rm -f masqmail$(EXEEXT) $(LINK) $(masqmail_OBJECTS) $(masqmail_LDADD) $(LIBS) mservdetect$(EXEEXT): $(mservdetect_OBJECTS) $(mservdetect_DEPENDENCIES) @rm -f mservdetect$(EXEEXT) $(LINK) $(mservdetect_OBJECTS) $(mservdetect_LDADD) $(LIBS) readtest$(EXEEXT): $(readtest_OBJECTS) $(readtest_DEPENDENCIES) @rm -f readtest$(EXEEXT) $(LINK) $(readtest_OBJECTS) $(readtest_LDADD) $(LIBS) resolvtest$(EXEEXT): $(resolvtest_OBJECTS) $(resolvtest_DEPENDENCIES) @rm -f resolvtest$(EXEEXT) $(LINK) $(resolvtest_OBJECTS) $(resolvtest_LDADD) $(LIBS) smtpsend$(EXEEXT): $(smtpsend_OBJECTS) $(smtpsend_DEPENDENCIES) @rm -f smtpsend$(EXEEXT) $(LINK) $(smtpsend_OBJECTS) $(smtpsend_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) 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)/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)/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)/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)/resolvtest.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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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-sbinPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS 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: masqmail-0.3.4/src/accept.c0000644000000000000000000002751711705501561015673 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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" /* must match PROT_* in masqmail.h */ gchar *prot_names[] = { "local", "SMTP", "ESMTP", "(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; } /* ** accept message from anywhere. ** A message from local is indicated by msg->recieved_host == NULL ** ** The -t option: With the ACC_RCPT_FROM_HEAD flag the addrs found found ** in To/Cc/Bcc headers are added to the recipient 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_DOT_IGNORE))) { if (line[1] == '\n') { g_free(line); break; } line1++; } if ((len == -1) && (flags & (ACC_DOT_IGNORE | 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 if (len == -1) { g_free(line); return AERR_EOF; } else if (len == -2) { /* should not happen any more */ g_free(line); return AERR_OVERFLOW; } else if (len == -3) { g_free(line); return AERR_TIMEOUT; } else if (len <= 0) { /* does not happen */ g_free(line); DEBUG(5) debugf("read_sockline returned %d\n", len); return AERR_UNKNOWN; } if (in_headers) { /* some pop servers send the 'From ' line, skip it: */ if (!msg->hdr_list && strncmp(line1, "From ", 5) == 0) { continue; } if (line1[0] == ' ' || line1[0] == '\t') { /* continuation of 'folded' header: */ if (hdr) { char *cp; cp = g_strconcat(hdr->header, line1, NULL); hdr->value = cp + (hdr->value - hdr->header); free(hdr->header); hdr->header = cp; } } 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 { /* message body */ msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1)); data_size += strlen(line1); line_cnt++; } if (conf.max_msg_size && (data_size > conf.max_msg_size)) { DEBUG(4) debugf("accept_message_stream(): " "received %d bytes (conf.max_msg_size=%d)\n", data_size, conf.max_msg_size); return AERR_SIZE; } } DEBUG(4) debugf("received %d lines of data (%d bytes)\n", line_cnt, data_size); if (!msg->data_list) { /* make sure data list is not NULL: */ msg->data_list = g_list_append(NULL, g_strdup("")); } msg->data_list = g_list_reverse(msg->data_list); /* 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; 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 and set return path if missing */ if (!msg->received_host) { passwd = g_memdup(getpwuid(geteuid()), sizeof(struct passwd)); msg->ident = g_strdup(passwd->pw_name); if (!msg->return_path) { 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); } } /* scan headers */ { gboolean has_id = FALSE; gboolean has_date = FALSE; gboolean has_sender = FALSE; gboolean has_from = 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; 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: has_to_or_cc = TRUE; /* fall through */ case HEAD_BCC: if (flags & ACC_RCPT_FROM_HEAD) { /* -t option (see comment above) */ 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 (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); } 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) { /* ** TODO: do we still need this as we don't fetch ** mail anymore? ** 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); msg->return_path = create_address_qualified(addr, FALSE, msg->received_host); if (msg->return_path) { 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) { /* 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 unknown\n")); } } /* here we should have our recipients, fail if not: */ if (!msg->rcpt_list) { logwrite(LOG_WARNING, "no recipients found in message\n"); return AERR_NORCPT; } if (!has_sender && !has_from) { DEBUG(3) debugf("adding 'From:' header\n"); if (msg->full_sender_name) { msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_FROM, "From: \"%s\" <%s@%s>\n", msg->full_sender_name, msg->return_path->local_part, msg->return_path->domain)); } else { msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_FROM, "From: <%s@%s>\n", msg->return_path->local_part, msg->return_path->domain)); } } if (!has_to_or_cc) { DEBUG(3) debugf("no To: or Cc: header, hence adding `To: undisclosed recipients:;'\n"); msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_TO, "To: undisclosed-recipients:;\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 */ /* The `for' part will only be used if exactly one rcpt is present. */ 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("\n\tfor %s", addr_string(addr)); } if (!msg->received_host) { /* received locally */ hdr = create_header(HEAD_RECEIVED, "Received: by %s (%s %s, from userid %d)\n\tid %s%s; %s\n", conf.host_name, PACKAGE, VERSION, geteuid(), msg->uid, for_string ? for_string : "", rec_timestamp()); } else { /* received from remote */ DEBUG(5) debugf("adding 'Received:' header (5)\n"); hdr = create_header(HEAD_RECEIVED, "Received: from %s\n\tby %s with %s (%s %s)\n\tid %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()); } msg->hdr_list = g_list_prepend(msg->hdr_list, hdr); if (for_string) g_free(for_string); 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; } masqmail-0.3.4/src/address.c0000644000000000000000000001015311705501561016045 0ustar00usergroup00000000000000/* ** 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" 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 && 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) { return NULL; } if ((addr = g_malloc(sizeof(address))) == NULL) { return NULL; } 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, int (*cmpfunc) (const char*, const char*)) { return (cmpfunc(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, int (*cmpfunc) (const char*, const char*)) { address *addr; for (addr = addr1; addr; addr = addr->parent) if (addr_isequal(addr, addr2, cmpfunc)) 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; } masqmail-0.3.4/src/alias.c0000644000000000000000000001567711705501561015531 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 2000-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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; if (addr->domain == NULL) { return TRUE; } foreach(conf.local_hosts, dom_node) { /* Note: FNM_CASEFOLD is a GNU extension */ if (fnmatch(dom_node->data, addr->domain, FNM_CASEFOLD) != 0) { /* no match, try next */ continue; } foreach(conf.not_local_addresses, addr_node) { a = create_address_qualified(addr_node->data, TRUE, conf.host_name); DEBUG(6) debugf("not_local_addresses: addr_node->data=%s a->address=%s\n", addr_node->data, a->address); if (addr_isequal(a, addr, conf.localpartcmp)) { destroy_address(a); /* in local_hosts but also in not_local_addresses */ return FALSE; } destroy_address(a); } /* in local_hosts */ return TRUE; } foreach(conf.local_addresses, addr_node) { a = create_address_qualified(addr_node->data, TRUE, conf.host_name); DEBUG(6) debugf("local_addresses: addr_node->data=%s a->address=%s\n", addr_node->data, a->address); if (addr_isequal(a, addr, conf.localpartcmp)) { destroy_address(a); /* in local_addresses */ return TRUE; } destroy_address(a); } return FALSE; } 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; } /* ** addr is assumed to be local and no pipe address nor not-to-expand */ static GList* expand_one(GList *alias_table, address *addr) { GList *val_list; GList *val_node; GList *alias_list = NULL; GList *alias_node; gchar *val; /* expand the local alias */ DEBUG(6) debugf("alias: '%s' is local and will get expanded\n", addr->local_part); if (strcasecmp(addr->local_part, "postmaster") == 0) { /* ** postmaster must always be matched caseless ** see RFC 822 and RFC 5321 */ val = (gchar *) table_find_func(alias_table, addr->local_part, strcasecmp); } else { val = (gchar *) table_find_func(alias_table, addr->local_part, conf.localpartcmp); } if (!val) { DEBUG(5) debugf("alias: '%s' is fully expanded, hence completed\n", addr->local_part); return g_list_append(NULL, addr); } DEBUG(5) debugf("alias: '%s' -> '%s'\n", addr->local_part, val); val_list = parse_list(val); alias_list = NULL; foreach(val_list, val_node) { gchar *val = (gchar *) (val_node->data); address *alias_addr; DEBUG(6) debugf("alias: processing '%s'\n", val); if (val[0] == '\\') { DEBUG(5) debugf("alias: '%s' is marked as final, hence completed\n", val); alias_addr = create_address_qualified(val+1, TRUE, conf.host_name); g_free(val); DEBUG(6) debugf("alias: address generated: '%s'\n", alias_addr->local_part); alias_list = g_list_append(alias_list, alias_addr); continue; } if (val[0] == '|') { DEBUG(5) debugf("alias: '%s' is a pipe address\n", val); alias_addr = create_address_pipe(val); g_free(val); DEBUG(6) debugf("alias: pipe generated: %s\n", alias_addr->local_part); alias_list = g_list_append(alias_list, alias_addr); continue; } alias_addr = create_address_qualified(val, TRUE, conf.host_name); g_free(val); if (!addr_is_local(alias_addr)) { DEBUG(5) debugf("alias: '%s@%s' is non-local, hence completed\n", alias_addr->local_part, alias_addr->domain); alias_list = g_list_append(alias_list, alias_addr); continue; } /* addr is local and to expand at this point */ /* but first ... search in parents for loops: */ if (addr_isequal_parent(addr, alias_addr, conf.localpartcmp)) { /* loop detected, ignore this path */ logwrite(LOG_ALERT, "alias: detected loop, hence ignoring '%s'\n", alias_addr->local_part); continue; } alias_addr->parent = addr; /* recurse */ DEBUG(6) debugf("alias: >>\n"); alias_node = expand_one(alias_table, alias_addr); DEBUG(6) debugf("alias: <<\n"); if (alias_node) { alias_list = g_list_concat(alias_list, alias_node); } } g_list_free(val_list); addr->children = g_list_copy(alias_list); return alias_list; } GList* alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list) { GList *rcpt_node = NULL; GList *alias_list = NULL; GList *done_list = NULL; GList *rcpt_node_next = NULL; address *addr = NULL; for (rcpt_node=g_list_copy(rcpt_list); rcpt_node; rcpt_node=g_list_next(rcpt_node)) { addr = (address *) (rcpt_node->data); if (addr_is_local(addr)) { DEBUG(5) debugf("alias: (orig rcpt addr) expand local '%s'\n", addr->local_part); alias_list = expand_one(alias_table, addr); if (alias_list) { done_list = g_list_concat(done_list, alias_list); } } else { DEBUG(5) debugf("alias: (orig rcpt addr) don't expand non-local '%s@%s'\n", addr->local_part, addr->domain); done_list = g_list_append(done_list, addr); } } /* we're done if we don't have to remove rcpts */ if (!non_rcpt_list) { return done_list; } /* delete addresses of non_rcpt_list from done_list */ 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, conf.localpartcmp)) { done_list = g_list_remove_link(done_list, rcpt_node); g_list_free_1(rcpt_node); /* ** this address is still in the children ** lists of the original address, simply ** mark them delivered */ addr_mark_delivered(addr); break; } } } return done_list; } masqmail-0.3.4/src/base64/Makefile.am0000644000000000000000000000050611705501561017375 0ustar00usergroup00000000000000AM_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@ masqmail-0.3.4/src/base64/Makefile.in0000644000000000000000000003351511705501561017414 0ustar00usergroup00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : noinst_PROGRAMS = base64enc$(EXEEXT) base64dec$(EXEEXT) subdir = src/base64 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libbase64_a_AR = $(AR) $(ARFLAGS) libbase64_a_LIBADD = am_libbase64_a_OBJECTS = base64.$(OBJEXT) libbase64_a_OBJECTS = $(am_libbase64_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am_base64dec_OBJECTS = base64dec.$(OBJEXT) base64.$(OBJEXT) base64dec_OBJECTS = $(am_base64dec_OBJECTS) base64dec_DEPENDENCIES = am_base64enc_OBJECTS = base64enc.$(OBJEXT) base64.$(OBJEXT) base64enc_OBJECTS = $(am_base64enc_OBJECTS) base64enc_DEPENDENCIES = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) \ $(base64enc_SOURCES) DIST_SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) \ $(base64enc_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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@ GREP = @GREP@ INSTALL = @INSTALL@ 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@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RESOLV_LIBS = @RESOLV_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ 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 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@ all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/base64/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/base64/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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_OBJECTS) $(base64dec_LDADD) $(LIBS) base64enc$(EXEEXT): $(base64enc_OBJECTS) $(base64enc_DEPENDENCIES) @rm -f base64enc$(EXEEXT) $(LINK) $(base64enc_OBJECTS) $(base64enc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) 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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .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 html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am 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 # 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: masqmail-0.3.4/src/base64/base64.c0000644000000000000000000000572211705501561016576 0ustar00usergroup00000000000000/* ** 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. */ /* 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 +1); memset(outbuf, 0, ((len + 3) * 8) / 6 +1); 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 +1); memset(out, 0, (strlen(buf) + 3) + 1 +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; } } } out[*size] = '\0'; return out; } masqmail-0.3.4/src/base64/base64.h0000644000000000000000000000153311705501561016577 0ustar00usergroup00000000000000/* ** 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); masqmail-0.3.4/src/base64/base64dec.c0000644000000000000000000000041511705501561017244 0ustar00usergroup00000000000000#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); } masqmail-0.3.4/src/base64/base64enc.c0000644000000000000000000000045111705501561017256 0ustar00usergroup00000000000000#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); } masqmail-0.3.4/src/child.c0000644000000000000000000000313411705501561015504 0ustar00usergroup00000000000000/* ** 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 child(const char *command) { int pipe[2]; if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == 0) { pid_t pid; 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(1); } else if (pid == -1) { return -1; } else { close(pipe[0]); return pipe[1]; } } return -2; } masqmail-0.3.4/src/conf.c0000644000000000000000000005374311705501561015361 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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" 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(1); } 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(1); } } 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(9) 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(1); } /* 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")) == NULL) { logwrite(LOG_ALERT, "could not open %s for reading: %s\n", fname, strerror(errno)); exit(1); } gchar buf[256]; while (!feof(fptr)) { fgets(buf, 255, fptr); if (buf[0] && (buf[0] != '#') && (buf[0] != '\n')) { g_strchomp(buf); DEBUG(9) fprintf(stderr,"parse_list_file: item = %s\n", buf); list = g_list_append(list, g_strdup(buf)); } } fclose(fptr); 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(9) fprintf(stderr, "parsing list %s, file?:%d\n", line, read_file); 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(9) fprintf(stderr, "item = %s\n", buf); if (*p) p++; } return list; } /* ** Split the addrs at '@' into local_part and domain. Without an '@' ** everything is local_part. Create address structs, which are put into a ** list and returned. This funktion is used for lists of addrs containing ** globbing chars (* and ?). We don't need valid RFC821 addresses here, ** just patterns to match against. */ static GList* parse_address_glob_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); char *at; char *p; address *addr = calloc(1, sizeof(address)); for (p=item+strlen(item)-1; isspace(*p) || *p=='>'; p--) { *p = '\0'; } for (p=item; isspace(*p) || *p=='<'; p++) { } addr->address = strdup(p); at = strrchr(p, '@'); if (at) { *at = '\0'; addr->local_part = strdup(p); addr->domain = strdup(at+1); } else { addr->local_part = strdup(p); /* No `@', thus any domain is okay. */ addr->domain = "*"; } list = g_list_append(list, addr); DEBUG(6) debugf("parse_address_glob_list: read pattern `%s' `%s'\n", addr->local_part, addr->domain); 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) { return NULL; } 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(1); } 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(9) 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; DEBUG(9) fprintf(stderr,"rval=%s, address:port=%s:%i\n",line, iface->address, iface->port); return iface; } 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)) { /* empty */ } 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(9) fprintf(stderr, "read_lval()\n"); if (!eat_spaces(in)) return FALSE; c = fgetc(in); DEBUG(9) 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(9) 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(9) 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 == ';' || 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(9) 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(9) fprintf(stderr, "read_statement()\n"); /* eat comments and empty lines: */ if (!eat_comments(in)) return FALSE; if (!read_lval(in, lval, lsize)) { return FALSE; } DEBUG(9) fprintf(stderr, " lval = %s\n", lval); if ((c = fgetc(in) == '=')) { if (read_rval(in, rval, rsize)) { DEBUG(9) fprintf(stderr, " rval = %s\n", rval); return TRUE; } } else { DEBUG(9) fprintf(stderr," '=' expected after %s, char was '%c'\n", lval, c); 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.do_relay = TRUE; conf.localpartcmp = strcmp; conf.max_defer_time = 86400 * 4; /* 4 days */ conf.max_msg_size = 0; /* no limit on msg size */ conf.spool_dir = SPOOL_DIR; conf.mail_dir = "/var/mail"; conf.listen_addresses = g_list_append(NULL, parse_interface("localhost", 25)); if ((in = fopen(filename, "r")) == NULL) { logwrite(LOG_ALERT, "could not open config file %s: %s\n", filename, strerror(errno)); return FALSE; } gchar lval[256], rval[2048]; while (read_statement(in, lval, 256, rval, 2048)) { DEBUG(9) fprintf(stderr,"read_conf(): lval=%s\n", lval); 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) { logwrite(LOG_ALERT, "could not open %s: %s\n", rval, strerror(errno)); return FALSE; } fgets(buf, 255, fptr); g_strchomp(buf); conf.host_name = g_strdup(buf); fclose(fptr); } } 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, "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, "caseless_matching") == 0) { conf.localpartcmp = 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, "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 (strncmp(lval, "query_routes.", 13) == 0) { GList *file_list = parse_list(rval, FALSE); table_pair *pair = create_pair(lval+13, file_list); conf.query_routes = g_list_append(conf.query_routes, pair); } else if (strcmp(lval, "permanent_routes") == 0) { conf.perma_routes = parse_list(rval, FALSE); } else if (strcmp(lval, "online_query") == 0) conf.online_query = g_strdup(rval); else if (strcmp(lval, "do_queue") == 0) conf.do_queue = parse_boolean(rval); 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 ival = time_interval(rval); if (ival < 0) logwrite(LOG_WARNING, "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 if(strcmp(lval, "max_msg_size") == 0) { conf.max_msg_size = atol(rval); DEBUG(9) fprintf(stderr,"rval=%s, conf.max_msg_size=%ld\n", rval, conf.max_msg_size); } else logwrite(LOG_WARNING, "var '%s' not (yet) known, ignored\n", lval); } fclose(in); if (!conf.host_name) { logwrite(LOG_ALERT, "`host_name' MUST be set in masqmail.conf. See man page\n"); return FALSE; } 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); if (!conf.local_hosts) { char *shortname = strdup(conf.host_name); char *p = strchr(shortname, '.'); if (p) { *p = '\0'; } /* we don't care if shortname and conf.host_name are the same */ char *local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name); conf.local_hosts = parse_list(local_hosts_str, FALSE); free(shortname); free(local_hosts_str); } return TRUE; } connect_route* read_route(gchar *filename, gboolean is_perma) { 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 = route->filename; /* quick hack */ route->expand_h_sender_address = TRUE; route->is_perma = is_perma; route->do_pipelining = TRUE; if ((in = fopen(route->filename, "r")) == NULL) { logwrite(LOG_ALERT, "could not open route file %s: %s\n", route->filename, strerror(errno)); g_free(route); return NULL; } gchar lval[256], rval[2048]; while (read_statement(in, lval, 256, rval, 2048)) { if (strcmp(lval, "mail_host") == 0) route->mail_host = parse_interface(rval, 25); 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, "instant_helo") == 0) route->instant_helo = parse_boolean(rval); else if (strcmp(lval, "do_pipelining") == 0) route->do_pipelining = parse_boolean(rval); else if (strcmp(lval, "allowed_senders") == 0) route->allowed_senders = parse_address_glob_list(rval, TRUE); else if (strcmp(lval, "denied_senders") == 0) route->denied_senders = parse_address_glob_list(rval, TRUE); else if (strcmp(lval, "allowed_recipients") == 0) route->allowed_recipients = parse_address_glob_list(rval, TRUE); else if (strcmp(lval, "denied_recipients") == 0) route->denied_recipients = parse_address_glob_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, "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) { #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; } 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->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_senders); _g_list_free_all(r->denied_senders); _g_list_free_all(r->allowed_recipients); _g_list_free_all(r->denied_recipients); 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 if (r->pipe) g_free(r->pipe); g_free(r); } GList* read_route_list(GList *rf_list, gboolean is_perma) { 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_perma); 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); } masqmail-0.3.4/src/connect.c0000644000000000000000000000767011705501561016063 0ustar00usergroup00000000000000/* ** 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(1); } foreach(res_func_list, res_node) { resolve_func res_func; DEBUG(6) debugf(" foreach() body\n"); res_func = (resolve_func) (res_node->data); if (res_func == NULL) { logwrite(LOG_ALERT, "res_func == NULL !!!\n"); exit(1); } 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; } masqmail-0.3.4/src/deliver.c0000644000000000000000000006020511705501561016055 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2002 Oliver Kurth ** Copyright (C) 2008, 2010 markus schnalke ** ** 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 "smtp_out.h" /* ** 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) { ok_fail = fail_msg(msg, conf.errmsg_file, failed_list, err_fmt, args); g_list_free(failed_list); } if (defered_list) { 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_mbox(message *msg, GList *hdr_list, address *rcpt, address *env_addr) { 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); return TRUE; } /* prevents 'Resource temporarily unavailable (11)' */ if (errno != EAGAIN) { addr_mark_failed(rcpt); } else { addr_mark_defered(rcpt); } return FALSE; } gboolean deliver_local_pipe(message *msg, GList *hdr_list, address *rcpt, address *env_addr) { guint flags; DEBUG(1) debugf("attempting to deliver %s with pipe\n", msg->uid); flags = (conf.pipe_fromline) ? MSGSTR_FROMLINE : 0; flags |= (conf.pipe_fromhack) ? MSGSTR_FROMHACK : 0; if (pipe_out(msg, hdr_list, rcpt, &(rcpt->local_part[1]), flags)) { 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); return TRUE; } 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 */ } return FALSE; } gboolean deliver_local_mda(message *msg, GList *hdr_list, address *rcpt, address *env_addr) { gboolean ok = FALSE; gchar *cmd = g_malloc(256); GList *var_table = var_table_rcpt(var_table_msg(NULL, msg), rcpt); guint flags; DEBUG(1) debugf("attempting to deliver %s with mda\n", msg->uid); if (!expand(var_table, conf.mda, cmd, 256)) { logwrite(LOG_ALERT, "could not expand string %s\n", conf.mda); destroy_table(var_table); return FALSE; } flags = (conf.mda_fromline) ? MSGSTR_FROMLINE : 0; flags |= (conf.mda_fromhack) ? MSGSTR_FROMHACK : 0; if (pipe_out(msg, hdr_list, rcpt, cmd, flags)) { 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 */ } destroy_table(var_table); return ok; } gboolean deliver_local(msg_out *msgout) { message *msg = msgout->msg; GList *rcpt_list = msgout->rcpt_list; GList *rcpt_node; gboolean ok = FALSE, flag = FALSE, ok_fail = FALSE; DEBUG(5) debugf("deliver_local entered\n"); flag = (msg->data_list == NULL); if (flag && !spool_read_data(msg)) { logwrite(LOG_ALERT, "could not open data spool file for %s\n", msg->uid); return 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] == '|') { /* ** probably for expanded aliases, but why not done ** like with the mda? //meillo 2010-12-06 */ if (deliver_local_pipe(msg, hdr_list, rcpt, env_addr)) { ok = TRUE; } } 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)) { mbox_type = "mbox"; } else if (g_list_find_custom (conf.mda_users, user, _g_list_strcasecmp)) { mbox_type = "mda"; } if (strcmp(mbox_type, "mbox") == 0) { if (deliver_local_mbox(msg, hdr_list, rcpt, env_addr)) { ok = TRUE; } } else if (strcmp(mbox_type, "mda") == 0) { if (conf.mda) { if (deliver_local_mda(msg, hdr_list, rcpt, env_addr)) { ok = TRUE; } } else { logwrite(LOG_ALERT, "mbox type is mda, but no mda command given in configuration\n"); } } 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 (fnmatch(dom_node->data, rcpt->domain, FNM_CASEFOLD)==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"); foreach(msgout_list, msgout_node) { msg_out *msgout = (msg_out *) (msgout_node->data); gboolean flag, 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 && !spool_read_data(msg)) { logwrite(LOG_ALERT, "could not open data spool file for %s\n", msg->uid); 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)) { logwrite(LOG_ALERT, "could not expand string `%s'\n", route->pipe); destroy_table(var_table); continue; } 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); } } 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 = 25; /* paranoid check: */ if (!msgout_list) { logwrite(LOG_ALERT, "Ooops: empty list of messages in deliver_msglist_host()\n"); return FALSE; } if (!host) { /* XXX: what if mail_host isn't set? Is this possible? */ host = route->mail_host->address; port = route->mail_host->port; } if (route->wrapper) { psb = smtp_out_open_child(route->wrapper); if (psb) { psb->remote_host = host; } } else { psb = smtp_out_open(host, port, res_list); } if (!psb) { /* 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); gboolean ret = FALSE; addr_unmark_delivered(rcpt); if (route->connect_error_fail) { addr_mark_failed(rcpt); } else { addr_mark_defered(rcpt); } if (route->wrapper) { ret = delivery_failures(msgout->msg, msgout->rcpt_list, "could not open wrapper:\n\t%s", strerror(errno)); } else { ret = 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)); } if (ret) { deliver_finish(msgout); } } } return ok; } 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, route->instant_helo)) { /* 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", (route->wrapper) ? "" : host, psb->buffer)) { deliver_finish(msgout); } } } destroy_smtpbase(psb); return ok; } 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 && !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", (route->wrapper) ? "" : 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) && !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); } destroy_smtpbase(psb); return ok; } gboolean deliver_msglist_host(connect_route *route, GList *msgout_list, gchar *host, GList *res_list) { if (route->pipe) { DEBUG(5) debugf("with pipe\n"); return deliver_msglist_host_pipe(route, msgout_list, host, res_list); } else { DEBUG(5) debugf("with smtp\n"); 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; GList *mo_ph_list; GList *mo_ph_node; DEBUG(5) debugf("deliver_route_msgout_list entered, route->name = %s\n", route->name); if (route->mail_host) { /* this is easy... deliver everything to a smart host for relay */ return deliver_msglist_host(route, msgout_list, NULL, route->resolve_list); } /* this is not easy... */ mo_ph_list = route_msgout_list(route, msgout_list); /* okay, now we have ordered our messages by the hosts. */ if (!mo_ph_list) { return FALSE; } /* ** 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) { destroy_msg_out(msgout_cloned); continue; } /* filter by allowed envelope sender */ if (!route_sender_is_allowed(route, msgout->msg->return_path)) { DEBUG(6) debugf("sender `%s' is not allowed for this route\n", msgout->msg->return_path); destroy_msg_out(msgout_cloned); continue; } /* filter by allowed envelope rcpts */ GList *rcpt_list_allowed = NULL; GList *rcpt_list_notallowed = NULL; route_split_rcpts(route, msgout_cloned->rcpt_list, &rcpt_list_allowed, &rcpt_list_notallowed); if (!rcpt_list_allowed) { destroy_msg_out(msgout_cloned); continue; } 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); } if (msgout_list_deliver) { 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; 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) { if (spool_delete_all(msg)) { logwrite(LOG_NOTICE, "%s completed.\n", msg->uid); return TRUE; } return FALSE; } /* one not delivered address was found */ if (!spool_write(msg, FALSE)) { logwrite(LOG_ALERT, "could not write back spool header for %s\n", msg->uid); return FALSE; } DEBUG(2) debugf("spool header for %s written back.\n", msg->uid); return TRUE; } int deliver_remote(GList *remote_msgout_list) { int ok = TRUE; GList *route_list = NULL; GList *route_node; GList *rf_list = NULL; gchar *connect_name = NULL; if (!remote_msgout_list) { return FALSE; } /* perma routes */ if (conf.perma_routes) { DEBUG(5) debugf("processing perma_routes\n"); route_list = read_route_list(conf.perma_routes, TRUE); foreach(route_list, route_node) { connect_route *route = (connect_route *) (route_node->data); if (!deliver_route_msg_list(route, remote_msgout_list)) { ok = FALSE; } } destroy_route_list(route_list); } /* query routes */ connect_name = online_query(); if (!connect_name) { DEBUG(5) debugf("online query returned false\n"); return FALSE; } /* we are online! */ DEBUG(5) debugf("processing query_routes\n"); logwrite(LOG_NOTICE, "detected online configuration `%s'\n", connect_name); rf_list = (GList *) table_find(conf.query_routes, connect_name); if (!rf_list) { logwrite(LOG_ALERT, "route list with name '%s' not found.\n", connect_name); return FALSE; } route_list = read_route_list(rf_list, FALSE); if (!route_list) { logwrite(LOG_ALERT, "could not read route list '%s'\n", connect_name); return FALSE; } foreach(route_list, route_node) { connect_route *route = (connect_route *) (route_node->data); /* TODO: ok gets overwritten */ ok = deliver_route_msg_list(route, remote_msgout_list); } destroy_route_list(route_list); return ok; } /* ** This function splits the list of rcpt addresses ** into local and remote addresses and processes them accordingly. */ gboolean deliver_msg_list(GList *msg_list, guint flags) { GList *msgout_list = NULL; GList *msg_node; GList *local_msgout_list = NULL; GList *remote_msgout_list = NULL; GList *msgout_node; GList *alias_table = NULL; gboolean ok = TRUE; /* create msgout_list */ foreach(msg_list, msg_node) { message *msg = (message *) msg_node->data; msgout_list = g_list_append(msgout_list, create_msg_out(msg)); } if (conf.alias_file) { alias_table = table_read(conf.alias_file, ':'); } /* 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 *other_rcpt_list = NULL; if (!spool_lock(msgout->msg->uid)) { DEBUG(5) debugf("spool_lock(%s) failed.\n", msgout->msg->uid); continue; } DEBUG(5) debugf("spool_lock(%s)\n", msgout->msg->uid); 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); } else { logwrite(LOG_ALERT, "invalid log_user address `%s', ignoring\n", conf.log_user); } } 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; } /* split_rcpts(rcpt_list, NULL, &local_rcpt_list, NULL, &other_rcpt_list); */ local_rcpt_list = local_rcpts(rcpt_list); other_rcpt_list = remote_rcpts(rcpt_list); g_list_free(rcpt_list); /* local recipients */ if ((flags & DLVR_LOCAL) && local_rcpt_list) { 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); } /* remote recipients, requires online delivery */ if ((flags & DLVR_ONLINE) && other_rcpt_list) { msg_out *remote_msgout = clone_msg_out(msgout); remote_msgout->rcpt_list = other_rcpt_list; remote_msgout_list = g_list_append(remote_msgout_list, remote_msgout); } } if (alias_table) { destroy_table(alias_table); } /* process local/remote msgout lists -> delivery */ if (local_msgout_list) { DEBUG(5) debugf("local_msgout_list\n"); 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 (remote_msgout_list) { DEBUG(5) debugf("remote_msgout_list\n"); deliver_remote(remote_msgout_list); destroy_msg_out_list(remote_msgout_list); } /* unlock spool files */ foreach(msgout_list, msgout_node) { msg_out *msgout = (msg_out *) (msgout_node->data); if (spool_unlock(msgout->msg->uid)) { DEBUG(5) debugf("spool_unlock(%s)\n", msgout->msg->uid); } else { DEBUG(5) debugf("spool_unlock(%s) failed.\n", msgout->msg->uid); } } destroy_msg_out_list(msgout_list); return ok; } /* ** deliver() is called when a message has just been received ** (mode_accept and smtp_in) and should be delivered immediately ** (neither -odq nor do_queue). Only this one message will be tried to ** deliver then. */ 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; } masqmail-0.3.4/src/dotlock.c0000644000000000000000000000366411705501561016070 0ustar00usergroup00000000000000/* ** 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; } masqmail-0.3.4/src/dotlock.h0000644000000000000000000000161011705501561016062 0ustar00usergroup00000000000000/* ** 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); masqmail-0.3.4/src/expand.c0000644000000000000000000000670111705501561015703 0ustar00usergroup00000000000000/* ** 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; } masqmail-0.3.4/src/fail_msg.c0000644000000000000000000001167011705501561016206 0ustar00usergroup00000000000000/* ** 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, strcasecmp)) { 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); 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) != 0) || WIFSIGNALED(status)) { if (WEXITSTATUS(status) != 0) 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); 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); 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; } masqmail-0.3.4/src/header.c0000644000000000000000000001567211705501561015663 0ustar00usergroup00000000000000/* ** 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) { foreach(hdr_list, node) { header *hdr = (header *) (node->data); if (hdr->id == id) { found_list = g_list_append(found_list, hdr); } } return found_list; } foreach(hdr_list, node) { header *hdr = (header *) (node->data); gchar buf[64], *q = buf, *p = hdr->header; while (*p != ':' && q < buf+sizeof(buf)-1 && *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) { char *src = hdr->header; char *dest = src; char *p; p = strchr(src, '\n'); if (!p || !p[1]) { /* no folded header */ return; } while (*src) { if (*src == '\n') { /* ignore */ src++; } else { /* copy */ *(dest++) = *(src++); } } *(dest++) = '\n'; *(dest++) = '\0'; } /* ** fold the header at maxlen chars (newline excluded) ** (We exclude the newline because the RFCs deal with it this way) */ void header_fold(header *hdr, unsigned int maxlen) { int len = strlen(hdr->header); char *src = hdr->header; char *dest; char *tmp; char *p; int valueoffset; if (len <= maxlen) { /* we don't need to do anything */ return; } /* strip trailing whitespace */ for (p=src+len-1; *p==' '||*p=='\t'||*p=='\n'; p--) { *p = '\0'; len--; printf(" trailing whitespace\n"); } printf("stripped len: %d\n", len); /* ** FIXME: would be nice to have a better size calculation ** (the current size + what we insert as break, twice as often as ** we have breaks in the optimal case) */ tmp = malloc(len + 2 * (len/maxlen) * strlen("\n\t")); dest = tmp; /* the position in hdr->header where the value part start */ valueoffset = hdr->value - hdr->header; while (strlen(src) > maxlen) { char *pp; for (pp=src+maxlen; pp>src; pp--) { if (*pp==' ' || *pp=='\t' || *p=='\n') { break; } } if (src == pp) { /* no potential break point was found within maxlen so advance further until the next */ for (pp=src+maxlen; *pp; pp++) { if (*pp==' ' || *pp=='\t' || *p=='\n') { break; } } } if (!*pp) { break; } memcpy(dest, src, pp-src); dest += pp-src; *(dest++) = '\n'; *(dest++) = '\t'; while (*pp == ' ' || *pp == '\t' || *p=='\n') { pp++; } src = pp; } memcpy(dest, src, strlen(src)); dest += strlen(src); if (*(dest-1) != '\n') { *dest = '\n'; *(dest+1) = '\0'; } hdr->header = tmp; hdr->value = hdr->header + valueoffset; } header* create_header(header_id id, gchar *fmt, ...) { gchar *p; header *hdr; va_list args; va_start(args, fmt); /* g_malloc() calls exit on failure */ hdr = g_malloc(sizeof(header)); hdr->id = id; hdr->header = g_strdup_vprintf(fmt, args); hdr->value = NULL; /* ** value shall point to the first non-whitespace char in the ** value part of the header line (i.e. after the first colon) */ p = strchr(hdr->header, ':'); if (p) { p++; while (*p == ' ' || *p == '\t' || *p == '\n') { p++; } hdr->value = (*p) ? p : NULL; } DEBUG(3) debugf("create_header(): hdr: `%s'\n", hdr->header); DEBUG(3) debugf("create_header(): val: `%s'\n", hdr->value); 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) { 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+sizeof(buf)-1)) { *(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; /* ** Note: an empty value can also mean that it's only the first part ** of a folded header line */ 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); /* Note: This only outputs the first line if the header is folded */ return hdr; } masqmail-0.3.4/src/interface.c0000644000000000000000000000534511705501561016367 0ustar00usergroup00000000000000/* ** 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; } masqmail-0.3.4/src/listen.c0000644000000000000000000001247611705501561015730 0ustar00usergroup00000000000000/* ** 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 #include #include "masqmail.h" 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) != 0) 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); } 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)); logwrite(LOG_NOTICE, "connect from host %s, port %hd\n", rem_host, ntohs(sock_addr->sin_port)); /* 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(0); } else if (pid < 0) { logwrite(LOG_WARNING, "could not fork for incoming smtp connection: %s\n", strerror(errno)); } close(sock); close(dup_sock); } 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); 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(1); } 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); } /* 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) { set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL); } /* 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(1); } 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(1); } } } else if (sel_ret > 0) { 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 { /* ** 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(0); } else if (pid < 0) { logwrite(LOG_ALERT, "could not fork for queue run"); } } } } masqmail-0.3.4/src/local.c0000644000000000000000000001450211705501561015514 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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 "peopen.h" 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; uid_t saved_uid = geteuid(); gid_t saved_gid = getegid(); gboolean uid_ok = TRUE, gid_ok = TRUE; gchar *filename; FILE *out; /* headers may be special for a local delivery */ if (!hdr_list) hdr_list = msg->hdr_list; if (!(pw = getpwnam(user))) { logwrite(LOG_ALERT, "could not find password entry for user %s\n", user); errno = ENOENT; /* getpwnam does not set errno correctly */ return FALSE; } 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); } if (!uid_ok || !gid_ok) { logwrite(LOG_ALERT, "could not set uid or gid for local delivery, uid = %d: %s\n", pw->pw_uid, strerror(errno)); return FALSE; } } DEBUG(5) debugf("running as euid %d, egid %d\n", geteuid(), getegid()); filename = g_strdup_printf("%s/%s", conf.mail_dir, user); if (!(out = fopen(filename, "a"))) { logwrite(LOG_ALERT, "could not open file %s: %s\n", filename, strerror(errno)); } else { #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 } 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); logwrite(LOG_ALERT, "In case of trouble, see local.c:append_file() for details.\n", strerror(errno)); exit(1); } return ok; } 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; address *ancestor = addr_find_ancestor(rcpt); /* 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 */ n = 0; envp[n++] = g_strdup_printf("SENDER=%s@%s", msg->return_path->local_part, msg->return_path->domain); envp[n++] = g_strdup_printf("SENDER_DOMAIN=%s", msg->return_path->domain); envp[n++] = g_strdup_printf("SENDER_LOCAL=%s", msg->return_path->local_part); envp[n++] = g_strdup_printf("RECEIVED_HOST=%s", msg->received_host ? msg->received_host : ""); envp[n++] = g_strdup_printf("RETURN_PATH=%s@%s", msg->return_path->local_part, msg->return_path->domain); envp[n++] = g_strdup_printf("DOMAIN=%s", ancestor->domain); envp[n++] = g_strdup_printf("LOCAL_PART=%s", ancestor->local_part); envp[n++] = g_strdup_printf("USER=%s", ancestor->local_part); envp[n++] = g_strdup_printf("LOGNAME=%s", ancestor->local_part); envp[n++] = g_strdup_printf("MESSAGE_ID=%s", msg->uid); envp[n++] = g_strdup_printf("QUALIFY_DOMAIN=%s", conf.host_name); envp[n] = NULL; old_signal = signal(SIGCHLD, SIG_DFL); out = peidopen(cmd, "w", envp, &pid, conf.mail_uid, conf.mail_gid); if (!out) { logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", cmd, strerror(errno)); } else { 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; } 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; } masqmail-0.3.4/src/log.c0000644000000000000000000001077411705501561015212 0ustar00usergroup00000000000000/* ** 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" 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; if (!conf.run_as_user) { set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); } 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); if (!conf.run_as_user) { set_euidgid(saved_uid, saved_gid, NULL, NULL); } } #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); /* in case output ends not with newline */ } pri &= ~LOG_VERBOSE; if (!pri) { return; } 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]; strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); fprintf(file, "%s [%d] ", buf, getpid()); vfprintf(file, fmt, args); fflush(file); } } #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); } masqmail-0.3.4/src/lookup.c0000644000000000000000000001444511705501561015741 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) Oliver Kurth ** Copyright (C) markus schnalke ** ** 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 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; 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; } int dns_look_ip(gchar *domain, guint32 *ip) { gchar *n = domain; while (TRUE) { if (dns_resolve(n, T_A, FALSE) != 0) { return -1; } 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; } } } 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; } masqmail-0.3.4/src/lookup.h0000644000000000000000000000213111705501561015733 0ustar00usergroup00000000000000/* ** 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); int dns_look_ip(gchar *domain, guint32 *ip); masqmail-0.3.4/src/masqmail.c0000644000000000000000000004362711705501561016240 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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 no 'queue daemon' mode. ** It, as well as the distinction beween the two (non exclusive) daemon ** (queue and listen) modes, is handled by flags. */ enum mta_mode { MODE_NONE = 0, /* to check if a mode was set */ MODE_ACCEPT, /* accept message on stdin (fallback mode) */ MODE_DAEMON, /* run as daemon */ MODE_RUNQUEUE, /* single queue run, online or offline */ MODE_SMTP, /* accept SMTP on stdin */ MODE_LIST, /* list queue */ MODE_MCMD, /* do queue manipulation */ MODE_VERSION, /* show version */ MODE_BI, /* fake ;-) */ }; enum mta_mode mta_mode = MODE_NONE; 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 = geteuid(); if (seteuid(0) != 0) { logwrite(LOG_ALERT, "sigterm_handler: could not set euid to %d: %s\n", 0, strerror(errno)); } 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); } /* ** argv: the original argv ** argp: number of arg (may get modified!) ** cp: pointing to the char after the option ** e.g. `-d 6' `-d6' ** ^ ^ */ gchar* get_optarg(char *argv[], gint *argp, char *cp) { if (*cp) { /* this kind: -xval */ return cp; } cp = argv[*argp+1]; if (cp && (*cp != '-')) { /* this kind: -x val */ (*argp)++; return cp; } return NULL; } 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; } /* on -bd or if -q has an argument */ 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(1); } } /* reparent to init only if init is not already the parent */ if (getppid() != 1) { if ((pid = fork()) > 0) { exit(0); } else if (pid < 0) { logwrite(LOG_ALERT, "could not fork!\n"); exit(1); } } signal(SIGTERM, sigterm_handler); write_pidfile(PIDFILEDIR "/masqmail.pid"); conf.do_verbose = FALSE; /* ** closing and reopening the log ensures that it is open afterwards ** because it is possible that the log is assigned to fd 1 and gets ** thus closes by fclose(stdout). Similar for the debugfile. */ logclose(); fclose(stdin); fclose(stdout); fclose(stderr); logopen(); logwrite(LOG_NOTICE, "%s %s daemon starting\n", PACKAGE, VERSION); listen_port(do_listen ? conf.listen_addresses : NULL, queue_interval, argv); } /* -bs or called as smtpd or in.smtpd */ static void mode_smtp() { /* accept smtp message on stdin */ /* write responses to stderr. */ struct sockaddr_in saddr; gchar *peername = NULL; int dummy = sizeof(saddr); conf.do_verbose = FALSE; if (!conf.run_as_user) { set_euidgid(conf.orig_uid, conf.orig_gid, NULL, NULL); } 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)); } else if (errno != ENOTSOCK) exit(1); smtp_in(stdin, stderr, peername, NULL); } /* default mode if address args or -t is specified, or called as rmail */ 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; pid_t pid; if (return_path && !is_privileged_user(conf.orig_uid)) { fprintf(stderr, "must be root, %s or in group %s for setting return path.\n", DEF_MAIL_USER, DEF_MAIL_GROUP); exit(1); } if (!conf.run_as_user) { set_euidgid(conf.orig_uid, conf.orig_gid, NULL, NULL); } DEBUG(5) debugf("accepting message on stdin\n"); msg->received_prot = PROT_LOCAL; /* warn if -t option and cmdline addr args */ if (addr_cnt && (accept_flags & ACC_RCPT_FROM_HEAD)) { logwrite(LOG_ALERT, "command line address arguments are now *added* to the mail header\\\n"); logwrite(LOG_ALERT, " recipient addresses (instead of substracted) when -t is given.\\\n"); logwrite(LOG_ALERT, " this changed with version 0.3.1\n"); } for (i = 0; i < addr_cnt; i++) { if (addresses[i][0] == '|') { logwrite(LOG_ALERT, "no pipe allowed as recipient address: %s\n", addresses[i]); /* should we better ignore this one addr? */ exit(1); } msg->rcpt_list = g_list_append(msg->rcpt_list, create_address_qualified(addresses[i], TRUE, conf.host_name)); } /* -f option */ msg->return_path = return_path; /* -F option */ msg->full_sender_name = full_sender_name; err = accept_message(stdin, msg, accept_flags); switch (err) { case AERR_OK: /* to continue; all other cases exit */ break; case AERR_EOF: fprintf(stderr, "unexpected EOF.\n"); exit(1); case AERR_NORCPT: fprintf(stderr, "no recipients.\n"); exit(1); case AERR_SIZE: fprintf(stderr, "max message size exceeded.\n"); exit(1); default: /* should never happen: */ fprintf(stderr, "Unknown error (%d)\r\n", err); exit(1); } if (!spool_write(msg, TRUE)) { fprintf(stderr, "Could not write spool file\n"); exit(1); } /* here the mail is queued and thus in our responsibility */ logwrite(LOG_NOTICE, "%s <= %s with %s\n", msg->uid, addr_string(msg->return_path), prot_names[PROT_LOCAL]); if (conf.do_queue) { /* we're finished as we only need to queue it */ return; } /* deliver at once */ if ((pid = fork()) < 0) { logwrite(LOG_ALERT, "could not fork for delivery, id = %s\n", msg->uid); } else if (pid == 0) { conf.do_verbose = FALSE; fclose(stdin); fclose(stdout); fclose(stderr); if (deliver(msg)) { exit(0); } else { /* ** TODO: Should we really fail here? Because the ** mail is queued already. If we fail the client ** might submit it again. If at-once-delivery ** is seen as an additional best-effort service, ** then we should still exit successful here. */ exit(1); } } } /* ** if -Mrm is given ** ** currently only the `rm' command is supported ** until this changes, we don't need any facility for further commands ** return success if at least one message had been deleted */ static int manipulate_queue(char *cmd, char *id[]) { gboolean ok = FALSE; if (strcmp(cmd, "rm") != 0) { fprintf(stderr, "unknown command %s\n", cmd); return FALSE; } set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL); /* privileged users may delete any mail */ if (is_privileged_user(conf.orig_uid)) { for (; *id; id++) { fprintf(stderr, "id: %s\n", *id); if (queue_delete(*id)) { ok = TRUE; } } return ok; } struct passwd *pw = getpwuid(conf.orig_uid); if (!pw) { fprintf(stderr, "could not find a passwd entry for uid %d: %s\n", conf.orig_uid, strerror(errno)); return FALSE; } /* non-privileged users may only delete their own messages */ for (; *id; id++) { message *msg = msg_spool_read(*id); fprintf(stderr, "id: %s\n", *id); if (!msg->ident) { fprintf(stderr, "message %s does not have an ident\n", *id); continue; } if (strcmp(pw->pw_name, msg->ident) != 0) { fprintf(stderr, "you do not own message id %s\n", *id); continue; } if (msg->received_host || (msg->received_prot != PROT_LOCAL)) { fprintf(stderr, "message %s was not received locally\n", *id); continue; } ok = queue_delete(*id); } return ok; } /* -qo, -q (without argument), or called as runq */ static int run_queue(gboolean do_runq, gboolean do_runq_online, char *route_name) { int ret; /* queue runs */ set_identity(conf.orig_uid, "queue run"); if (do_runq) { ret = queue_run(); } if (do_runq_online) { if (route_name) { conf.online_query = g_strdup_printf("/bin/echo %s", route_name); } /* ** TODO: change behavior of `-qo without argument'? ** Because that behavior is included in -q. */ ret = queue_run_online(); } return ret; } /* -bV or default mode if neither addr arg nor -t */ static void mode_version(void) { gchar *with_resolver = ""; gchar *with_auth = ""; #ifdef ENABLE_RESOLVER with_resolver = " +resolver"; #endif #ifdef ENABLE_AUTH with_auth = " +auth"; #endif printf("%s %s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth); } void set_mode(enum mta_mode mode) { if (mta_mode && mta_mode!=mode) { fprintf(stderr, "operation mode was already specified (%d vs. %d)\n", mta_mode, mode); exit(1); } mta_mode = mode; return; } int main(int argc, char *argv[]) { gchar *progname; char *opt; gint arg; gboolean do_listen = FALSE; gboolean do_runq = FALSE; gboolean do_runq_online = FALSE; gboolean do_queue = FALSE; gint queue_interval = 0; gchar *M_cmd = NULL; gboolean opt_t = FALSE; gboolean opt_i = FALSE; gchar *conf_file = CONF_FILE; gchar *route_name = NULL; gchar *f_address = NULL; address *return_path = NULL; /* may be changed by -f option */ gchar *full_sender_name = NULL; gboolean do_verbose = FALSE; gint debug_level = -1; /* strip the path part */ progname = strrchr(argv[0], '/'); progname = (progname) ? progname+1 : 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, "newaliases") == 0) { mta_mode = MODE_BI; } else if (strcmp(progname, "rmail") == 0) { /* ** the `rmail' alias should probably be removed now ** that we have the rmail script. But let's keep it ** for some while for compatibility. 2010-06-19 */ mta_mode = MODE_ACCEPT; opt_i = TRUE; } else if (strcmp(progname, "runq") == 0) { mta_mode = MODE_RUNQUEUE; do_runq = TRUE; } else if (strcmp(progname, "smtpd") == 0 || strcmp(progname, "in.smtpd") == 0) { mta_mode = MODE_SMTP; } /* parse cmd line */ for (arg=1; arg= 0) { /* if >= 0, it was given by argument */ conf.debug_level = debug_level; } /* ** It appears that changing to / ensures that we are never in ** a directory which we cannot access. This situation could be ** possible after changing identity. ** Maybe we should only change to / if we not run as user, to ** allow relative paths for log files in test setups for ** instance. */ 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(1); } if (setuid(0) != 0) { fprintf(stderr, "could not gain root privileges. Is the setuid bit set? : %s\n", strerror(errno)); exit(1); } } if (!logopen()) { fprintf(stderr, "could not open log file\n"); exit(1); } 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(1); } } switch (mta_mode) { case MODE_DAEMON: mode_daemon(do_listen, queue_interval, argv); break; case MODE_RUNQUEUE: exit(run_queue(do_runq, do_runq_online, route_name) ? 0 : 1); break; case MODE_SMTP: mode_smtp(); break; case MODE_LIST: queue_list(); break; case MODE_BI: exit(0); break; /* well... */ case MODE_MCMD: exit(manipulate_queue(M_cmd, &argv[arg]) ? 0 : 1); break; case MODE_ACCEPT: { guint accept_flags = (opt_t ? ACC_RCPT_FROM_HEAD : 0) | (opt_i ? ACC_DOT_IGNORE : ACC_NODOT_RELAX); mode_accept(return_path, full_sender_name, accept_flags, &(argv[arg]), argc - arg); exit(0); } break; default: fprintf(stderr, "unknown mode: %d\n", mta_mode); break; } logclose(); exit(0); } masqmail-0.3.4/src/masqmail.h0000644000000000000000000003456411705501561016245 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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 #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 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; gboolean is_perma; gboolean last_route; GList *allowed_senders; GList *denied_senders; GList *allowed_recipients; GList *denied_recipients; interface *mail_host; gboolean connect_error_fail; GList *resolve_list; gchar *helo_name; gboolean do_correct_helo; gboolean instant_helo; gboolean do_pipelining; gchar *auth_name; gchar *auth_login; gchar *auth_secret; gchar *wrapper; 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; gchar *pipe; gboolean pipe_fromline; gboolean pipe_fromhack; } connect_route; 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 *listen_addresses; /* ** ANSI C defines unsigned long to be at least 32bit ** i.e. ca. 4GB max; that should be enough. */ gulong max_msg_size; gboolean do_save_envelope_to; gboolean defer_all; gboolean do_relay; gboolean do_queue; gboolean do_verbose; gchar *mbox_default; GList *mbox_users; GList *mda_users; gchar *mda; gboolean mda_fromline; gboolean mda_fromhack; gboolean pipe_fromline; gboolean pipe_fromhack; gchar *alias_file; int (*localpartcmp) (const char *, const char *); GList *perma_routes; GList *query_routes; /* list of pairs which point to lists */ gchar *online_query; 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; /* must match the contents of prot_names[] in accept.c */ typedef enum _prot_id { PROT_LOCAL = 0, PROT_SMTP, PROT_ESMTP, 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; /* rewritten headers */ } msg_out; typedef struct _msgout_perhost { gchar *host; GList *msgout_list; } msgout_perhost; /* flags for accept() */ #define ACC_RCPT_FROM_HEAD 0x08 /* -t option, get rcpts from headers */ #define ACC_DOT_IGNORE 0x10 /* a dot on a line itself does not end the message (-oi option) */ #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_ONLINE 0x02 #define DLVR_ALL (DLVR_LOCAL|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_SIZE, /* max msg size exeeded (SMTP SIZE) */ 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_perma); GList *read_route_list(GList *rf_list, gboolean is_perma); void destroy_route(connect_route *r); void destroy_route_list(GList *list); /* 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); 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, int (*cmpfunc) (const char*, const char*)); gboolean addr_isequal_parent(address *addr1, address *addr2, int (*cmpfunc) (const char*, const char*)); 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); /* 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, unsigned int maxlen); 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); /* 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_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); /* 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 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); message *msg_spool_read(gchar *uid); 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(void); gboolean queue_run(void); gboolean queue_run_online(void); void queue_list(void); gboolean queue_delete(gchar *uid); /* online.c */ gchar *online_query(); /* 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 split_rcpts(GList *rcpt_list, GList *localnets, GList **rl_local, GList **rl_localnet, GList **rl_others); GList *local_rcpts(GList *rcpt_list); GList *remote_rcpts(GList *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_sender_is_allowed(connect_route *route, address *ret_path); void route_split_rcpts(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); /* 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; masqmail-0.3.4/src/md5/Makefile.am0000644000000000000000000000035211705501561016775 0ustar00usergroup00000000000000AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE noinst_LIBRARIES=libmd5.a noinst_PROGRAMS=hmactest hmactest_SOURCES=\ md5.h\ md5.c\ hmac_md5.h\ hmac_md5.c\ hmactest.c libmd5_a_SOURCES=\ md5.h\ md5.c\ hmac_md5.h\ hmac_md5.c masqmail-0.3.4/src/md5/Makefile.in0000644000000000000000000003256411705501561017020 0ustar00usergroup00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : noinst_PROGRAMS = hmactest$(EXEEXT) subdir = src/md5 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libmd5_a_AR = $(AR) $(ARFLAGS) libmd5_a_LIBADD = am_libmd5_a_OBJECTS = md5.$(OBJEXT) hmac_md5.$(OBJEXT) libmd5_a_OBJECTS = $(am_libmd5_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am_hmactest_OBJECTS = md5.$(OBJEXT) hmac_md5.$(OBJEXT) \ hmactest.$(OBJEXT) hmactest_OBJECTS = $(am_hmactest_OBJECTS) hmactest_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmd5_a_SOURCES) $(hmactest_SOURCES) DIST_SOURCES = $(libmd5_a_SOURCES) $(hmactest_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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@ GREP = @GREP@ INSTALL = @INSTALL@ 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@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RESOLV_LIBS = @RESOLV_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ 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 = libmd5.a hmactest_SOURCES = \ md5.h\ md5.c\ hmac_md5.h\ hmac_md5.c\ hmactest.c libmd5_a_SOURCES = \ md5.h\ md5.c\ hmac_md5.h\ hmac_md5.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/md5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/md5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmd5.a: $(libmd5_a_OBJECTS) $(libmd5_a_DEPENDENCIES) -rm -f libmd5.a $(libmd5_a_AR) libmd5.a $(libmd5_a_OBJECTS) $(libmd5_a_LIBADD) $(RANLIB) libmd5.a clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) hmactest$(EXEEXT): $(hmactest_OBJECTS) $(hmactest_DEPENDENCIES) @rm -f hmactest$(EXEEXT) $(LINK) $(hmactest_OBJECTS) $(hmactest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) 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)/md5.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .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 html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am 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 # 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: masqmail-0.3.4/src/md5/hmac_md5.c0000644000000000000000000000517611705501561016573 0ustar00usergroup00000000000000/* ** hmac_md5 -- implements RFC 2104 ** ** Copyright 2010, markus schnalke ** ** Permission to use, copy, modify, and/or distribute this software for any ** purpose with or without fee is hereby granted, provided that the above ** copyright notice and this permission notice appear in all copies. ** ** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ** ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ** WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ** ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ** ** ** My motivation to write this code was the lack of a nicely licensed ** hmac_md5 function in C. I programmed it following the RFC's text. ** Obviously this code is highly similar to the sample code of the RFC. ** The code is tested against the test vectors of the RFC. Wikipedia's ** HMAC page helped me to understand the algorithm better. ** ** This hmac_md5 function requires an OpenSSL-compatible MD5 ** implementation. There are Public Domain MD5 implementations by Colin ** Plumb and by Solar Designer. You probably want to use one of these. */ #include #include "md5.h" const int blocksize = 64; const int hashsize = 16; /* ** The computed HMAC will be written to `digest'. ** Ensure digest points to hashsize bytes of allocated memory. */ void hmac_md5(unsigned char *text, int textlen, unsigned char *key, int keylen, unsigned char *digest) { int i; MD5_CTX context; unsigned char ipad[blocksize]; unsigned char opad[blocksize]; /* too long keys are replaced by their hash value */ if (keylen > blocksize) { MD5_Init(&context); MD5_Update(&context, key, keylen); MD5_Final(digest, &context); key = digest; keylen = hashsize; } /* copy the key into the pads */ memset(ipad, 0, sizeof(ipad)); memcpy(ipad, key, keylen); memset(opad, 0, sizeof(opad)); memcpy(opad, key, keylen); /* xor the pads with their ``basic'' value */ for (i=0; i #include #include #include #include "md5.h" #include "hmac_md5.h" /* ** instead of pad0_copy(d, s, sz) use: ** memset(d, 0, sz); ** memcpy(d, s, strlen(s)); ** ** 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; 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("%.2x", 0xFF & (unsigned int) digest[i]); printf("\n\n"); puts("---- The next two should be equal"); hmac_md5(msgid, strlen(msgid), "tanstaaftanstaaf", 16, digest); for (i = 0; i < 16; i++) printf("%.2x", 0xFF & (unsigned int) digest[i]); printf("\n\n"); /* pad0_copy(secret, "tanstaaftanstaaf", 64); */ /* let's do it easier ... */ memset(secret, 0, sizeof(secret)); memcpy(secret, "tanstaaftanstaaf", 16); hmac_md5(msgid, strlen(msgid), secret, 64, digest); for (i = 0; i < 16; i++) printf("%.2x", 0xFF & (unsigned int) digest[i]); printf("\n\n"); puts("---- Following are the test vectors from RFC 2104"); char *d01 = "Hi There"; char k01[16]; for (i=0; i<16; i++) { k01[i] = 0x0b; } printf("9294727a3638bb1c13f48ef8158bfc9d (should be)\n"); hmac_md5(d01, strlen(d01), k01, sizeof(k01), digest); for (i = 0; i < 16; i++) { printf("%.2x", 0xFF & (unsigned int) digest[i]); } printf(" (was computed)\n\n"); char *d02 = "what do ya want for nothing?"; char *k02 = "Jefe"; printf("750c783e6ab0b503eaa86e310a5db738 (should be)\n"); hmac_md5(d02, strlen(d02), k02, strlen(k02), digest); for (i = 0; i < 16; i++) { printf("%.2x", 0xFF & (unsigned int) digest[i]); } printf(" (was computed)\n\n"); char d03[50]; for (i=0; i in 2001, and placed * in the public domain. There's absolutely no warranty. * * This differs from Colin Plumb's older public domain implementation in * that no 32-bit integer data type is required, there's no compile-time * endianness configuration, and the function prototypes match OpenSSL's. * The primary goals are portability and ease of use. * * This implementation is meant to be fast, but not as fast as possible. * Some known optimizations are not included to reduce source code size * and avoid compile-time configuration. */ #ifndef HAVE_OPENSSL #include #include "md5.h" /* * The basic MD5 functions. * * F and G are optimized compared to their RFC 1321 definitions for * architectures that lack an AND-NOT instruction, just like in Colin Plumb's * implementation. */ #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | ~(z))) /* * The MD5 transformation for all four rounds. */ #define STEP(f, a, b, c, d, x, t, s) \ (a) += f((b), (c), (d)) + (x) + (t); \ (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ (a) += (b); /* * SET reads 4 input bytes in little-endian byte order and stores them * in a properly aligned word in host byte order. * * The check for little-endian architectures that tolerate unaligned * memory accesses is just an optimization. Nothing will break if it * doesn't work. */ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) #define SET(n) \ (*(MD5_u32plus *)&ptr[(n) * 4]) #define GET(n) \ SET(n) #else #define SET(n) \ (ctx->block[(n)] = \ (MD5_u32plus)ptr[(n) * 4] | \ ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) #define GET(n) \ (ctx->block[(n)]) #endif /* * This processes one or more 64-byte data blocks, but does NOT update * the bit counters. There are no alignment requirements. */ static void *body(MD5_CTX *ctx, void *data, unsigned long size) { unsigned char *ptr; MD5_u32plus a, b, c, d; MD5_u32plus saved_a, saved_b, saved_c, saved_d; ptr = data; a = ctx->a; b = ctx->b; c = ctx->c; d = ctx->d; do { saved_a = a; saved_b = b; saved_c = c; saved_d = d; /* Round 1 */ STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) STEP(F, c, d, a, b, SET(2), 0x242070db, 17) STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) /* Round 2 */ STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) STEP(G, d, a, b, c, GET(10), 0x02441453, 9) STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) /* Round 3 */ STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) /* Round 4 */ STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) a += saved_a; b += saved_b; c += saved_c; d += saved_d; ptr += 64; } while (size -= 64); ctx->a = a; ctx->b = b; ctx->c = c; ctx->d = d; return ptr; } void MD5_Init(MD5_CTX *ctx) { ctx->a = 0x67452301; ctx->b = 0xefcdab89; ctx->c = 0x98badcfe; ctx->d = 0x10325476; ctx->lo = 0; ctx->hi = 0; } void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) { MD5_u32plus saved_lo; unsigned long used, free; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) ctx->hi++; ctx->hi += size >> 29; used = saved_lo & 0x3f; if (used) { free = 64 - used; if (size < free) { memcpy(&ctx->buffer[used], data, size); return; } memcpy(&ctx->buffer[used], data, free); data = (unsigned char *)data + free; size -= free; body(ctx, ctx->buffer, 64); } if (size >= 64) { data = body(ctx, data, size & ~(unsigned long)0x3f); size &= 0x3f; } memcpy(ctx->buffer, data, size); } void MD5_Final(unsigned char *result, MD5_CTX *ctx) { unsigned long used, free; used = ctx->lo & 0x3f; ctx->buffer[used++] = 0x80; free = 64 - used; if (free < 8) { memset(&ctx->buffer[used], 0, free); body(ctx, ctx->buffer, 64); used = 0; free = 64; } memset(&ctx->buffer[used], 0, free - 8); ctx->lo <<= 3; ctx->buffer[56] = ctx->lo; ctx->buffer[57] = ctx->lo >> 8; ctx->buffer[58] = ctx->lo >> 16; ctx->buffer[59] = ctx->lo >> 24; ctx->buffer[60] = ctx->hi; ctx->buffer[61] = ctx->hi >> 8; ctx->buffer[62] = ctx->hi >> 16; ctx->buffer[63] = ctx->hi >> 24; body(ctx, ctx->buffer, 64); result[0] = ctx->a; result[1] = ctx->a >> 8; result[2] = ctx->a >> 16; result[3] = ctx->a >> 24; result[4] = ctx->b; result[5] = ctx->b >> 8; result[6] = ctx->b >> 16; result[7] = ctx->b >> 24; result[8] = ctx->c; result[9] = ctx->c >> 8; result[10] = ctx->c >> 16; result[11] = ctx->c >> 24; result[12] = ctx->d; result[13] = ctx->d >> 8; result[14] = ctx->d >> 16; result[15] = ctx->d >> 24; memset(ctx, 0, sizeof(*ctx)); } #endif masqmail-0.3.4/src/md5/md5.h0000644000000000000000000000154111705501561015600 0ustar00usergroup00000000000000/* * This is an OpenSSL-compatible implementation of the RSA Data Security, * Inc. MD5 Message-Digest Algorithm (RFC 1321). * * Written by Solar Designer in 2001, and placed * in the public domain. There's absolutely no warranty. * * See md5.c for more information. */ #ifdef HAVE_OPENSSL #include #elif !defined(_MD5_H) #define _MD5_H /* Any 32-bit or wider unsigned integer data type will do */ /* Note: Using an int will work on most systems and might perform much better */ typedef unsigned long MD5_u32plus; typedef struct { MD5_u32plus lo, hi; MD5_u32plus a, b, c, d; unsigned char buffer[64]; MD5_u32plus block[16]; } MD5_CTX; extern void MD5_Init(MD5_CTX *ctx); extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size); extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); #endif masqmail-0.3.4/src/message.c0000644000000000000000000001223211705501561016044 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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; } /* ** This function is currently (0.2.24) only used for client side SMTP ** SIZE support (RFC 1870). The flag is_smtp is always true therefore. ** ** Their definition of the message size in RFC 1870 is: ** ** The message size is defined as the number of octets, including ** CR-LF pairs, but not the SMTP DATA command's terminating dot ** or doubled quoting dots, to be transmitted by the SMTP client ** after receiving reply code 354 to the DATA command. ** ** l_cnt (line count) covers '\r' characters which are not present in ** masqmail's internal format. Dots are also not stuffed in the ** internal format. Dot-stuffing is ignored in the size. */ gint msg_calc_size(message *msg, gboolean is_smtp) { GList *node; gint l_cnt = 0; /* line count (we need to add so many '\r' for SMTP) */ gint c_cnt = 0; /* character count */ /* message 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++; /* message 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) { return; } 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 = g_malloc0(sizeof(msg_out)); msgout->msg = msg; 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; } 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); } masqmail-0.3.4/src/mservdetect.c0000644000000000000000000000665211705501561016756 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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" gboolean init_sockaddr2(struct sockaddr_in *name, gchar *addr, int port) { struct hostent *he; struct in_addr ia; if (inet_aton(addr, &ia) != 0) { /* IP address */ memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr)); } else { if ((he = gethostbyname(addr)) == NULL) { fprintf(stderr, "local address '%s' unknown. (deleting)\n", addr); return FALSE; } memcpy(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr)); } name->sin_family = AF_INET; name->sin_port = htons(port); return TRUE; } gchar* mserver_detect_online(gchar *addr, int port) { struct sockaddr_in saddr; gchar *ret = NULL; if (!init_sockaddr2(&saddr, addr, port)) { return NULL; } int sock = socket(PF_INET, SOCK_STREAM, 0); int dup_sock; if (connect(sock, (struct sockaddr *) (&saddr), sizeof(saddr)) != 0) { return NULL; } 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)) { return NULL; } /* ** this is the protocol (reverse engineered): ** ** S: READY ** C: STAT ** | ** +----------------+-----------------+ ** | | | ** S: DOWN S: UP foo:-1 S: UP foo:1 ** C: QUIT C: QUIT C: QUIT ** ** -> offline -> offline -> online ** `foo' gets printed ** */ 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) { /* `UP foo:N', where `N' is a non-negative number */ ret = g_strdup(buf + 3); } } else { fprintf(stderr, "unexpected response from mserver after STAT cmd: %s", buf); } } else { fprintf(stderr, "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; } int main(int argc, char *argv[]) { gchar *addr; int port; gchar *name; if (argc != 3) { fprintf(stderr, "usage: %s HOST PORT\n", argv[0]); return 1; } addr = argv[1]; port = atoi(argv[2]); name = mserver_detect_online(addr, port); if (name) { printf("%s\n", name); return 0; } return 1; } masqmail-0.3.4/src/online.c0000644000000000000000000000350011705501561015702 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2008, 2010 markus schnalke ** ** 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 "masqmail.h" #include "peopen.h" gchar* online_query() { gchar *pipe = conf.online_query; pid_t pid; void (*old_signal) (int); int status; FILE *in; gchar *name = NULL; if (!conf.online_query) { return NULL; } DEBUG(3) debugf("online query `%s'\n", pipe); old_signal = signal(SIGCHLD, SIG_DFL); in = peopen(pipe, "r", environ, &pid); if (!in) { logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", pipe, strerror(errno)); signal(SIGCHLD, old_signal); return NULL; } gchar output[256]; if (fgets(output, 255, in)) { g_strchomp(g_strchug(output)); if (strlen(output) == 0) { logwrite(LOG_ALERT, "only whitespace connection name\n"); name = NULL; } else { name = g_strdup(output); } } else { logwrite(LOG_ALERT, "nothing read from pipe %s\n", pipe); name = NULL; } fclose(in); waitpid(pid, &status, 0); if (WEXITSTATUS(status) != 0) { g_free(name); name = NULL; } signal(SIGCHLD, old_signal); return name; } masqmail-0.3.4/src/parse.c0000644000000000000000000002425711705501561015544 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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) { g_free(parse_error); parse_error = NULL; } /* leading spaces and angle brackets */ while (*p && (isspace(*p) || (*p == '<'))) { if (*p == '<') { angle_brackets++; } p++; } if (!*p) { return FALSE; } while (TRUE) { if (!read_word_with_dots(p, &b, &e)) { return FALSE; } 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 == '@' || *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)) { return FALSE; } p = e; *domain_begin = b; *domain_end = e; } else { /* unqualified? */ /* something like `To: alice, bob' with -t */ *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)) { return FALSE; } p = e; *local_begin = b; *local_end = e; #ifdef PARSE_TEST g_print("found local part: %s\n", *local_begin); #endif if (*p == '@') { p++; if (!read_domain(p, &b, &e)) { return FALSE; } p = e; *domain_begin = b; *domain_end = e; } 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); #ifdef PARSE_TEST g_print("unexpected character: %c", *p); #endif 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) { parse_error = g_strdup("missing '>' at end of string"); return FALSE; } else if (angle_brackets < 0) { parse_error = g_strdup("superfluous '>' at end of string"); return FALSE; } /* we successfully parsed the address */ return TRUE; } 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) { return FALSE; } while (TRUE) { if (!read_word_with_dots(p, &b, &e)) { return FALSE; } 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; } } /* 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) { parse_error = g_strdup("missing '>' at end of string"); return FALSE; } else if (angle_brackets < 0) { parse_error = g_strdup("superfluous '>' at end of string"); return FALSE; } /* we successfully parsed the address */ return TRUE; } /* ** allocate address, reading from string. ** On failure, returns NULL. ** after call, end contains 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; gboolean ret; /* TODO: what about (string == NULL)? */ if (string && (string[0] == '\0')) { address *addr = g_malloc(sizeof(address)); addr->address = g_strdup(""); addr->local_part = g_strdup(""); /* 'NULL' address (failure notice), "" makes sure it will not be qualified with a hostname */ addr->domain = g_strdup(""); return addr; } if (is_rfc821) { ret = parse_address_rfc821(string, &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end); } else { ret = parse_address_rfc822(string, &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end); } if (!ret) { return NULL; } 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') { /* 'NULL' address (failure notice), "" makes sure it will not be qualified with a hostname */ addr->domain = g_strdup(""); } else { addr->domain = NULL; } if (end) { *end = p; } #ifndef PARSE_TEST addr_unmark_delivered(addr); #endif return addr; } 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) { #ifdef PARSE_TEST g_print("string: %s\n", p); #endif address *addr = _create_address(p, &end, FALSE); if (!addr) { break; } #ifdef PARSE_TEST g_print("addr: %s (%s<@>%s)", addr->address, addr->local_part, addr->domain); #endif if (domain && !addr->domain) { addr->domain = g_strdup(domain); } #ifdef PARSE_TEST g_print(" (%s<@>%s)\n", addr->local_part, addr->domain); #endif addr_list = g_list_append(addr_list, addr); p = end; while (*p == ',' || isspace(*p)) { p++; } } return addr_list; } masqmail-0.3.4/src/peopen.c0000644000000000000000000000512211705501561015706 0ustar00usergroup00000000000000/* ** This a snippet I found in sourceforge. I just changed the identing ** style to my own and deleted the main function. -- oku ** The functions destroy_argv() and create_argv() were added by oku. */ #include #include #include #include #include #include #include #include "peopen.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 **) g_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); } masqmail-0.3.4/src/peopen.h0000644000000000000000000000030711705501561015713 0ustar00usergroup00000000000000FILE *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); masqmail-0.3.4/src/permissions.c0000644000000000000000000000454511705501561017003 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 2000 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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" /* is there really no function in libc for this? */ gboolean is_ingroup(uid_t uid, gid_t gid) { struct group *grent = getgrgid(gid); struct passwd *pwent = getpwuid(uid); char *entry; int i = 0; if (!grent) { return FALSE; } if (!pwent) { return FALSE; } /* check primary group */ if (pwent->pw_gid == gid) { return TRUE; } /* check secondary groups */ while ((entry = grent->gr_mem[i++])) { if (strcmp(pwent->pw_name, entry) == 0) return TRUE; } return FALSE; } gboolean is_privileged_user(uid_t uid) { /* uncomment these lines if you need the `uucp' group to be trusted too struct group *grent = getgrnam("uucp"); if (is_ingroup(uid, grent->gr_gid)) { return TRUE; } */ 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(1); } if (seteuid(uid) != 0) { logwrite(LOG_ALERT, "could not change uid to %d: %s\n", uid, strerror(errno)); exit(1); } } 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(1); } set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL); } } masqmail-0.3.4/src/queue.c0000644000000000000000000001300011705501561015536 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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" 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(void) { GList *msg_list = NULL; glob_t gl; gchar *pattern; int i, *idx_arr; /* ** Escaping the question marks prevents them from being ** interpreted as trigraphs */ 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)); 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(); if (msg_list) { ok = deliver_msg_list(msg_list, DLVR_ALL); DEBUG(5) debugf(" deliver_msg_list() returned: %d\n", ok); destroy_msg_list(msg_list); } logwrite(LOG_NOTICE, "Finished queue run.\n"); return ok; } gboolean queue_run_online() { GList *msg_list; gboolean ok = TRUE; logwrite(LOG_NOTICE, "Starting online queue run.\n"); msg_list = read_queue(); if (msg_list) { ok = deliver_msg_list(msg_list, DLVR_ONLINE); DEBUG(5) debugf(" deliver_msg_list() returned: %d\n", ok); 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(); if (msg_list == NULL) { printf("mail queue is empty.\n"); return; } 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); } } 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)) { fprintf(stderr, "message %s is locked.\n", uid); return FALSE; } 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); return (dat_ok && hdr_ok); } masqmail-0.3.4/src/readsock.c0000644000000000000000000000650111705501561016215 0ustar00usergroup00000000000000/* ** 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 #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 = (char *) malloc(size); if (!*pbuf) { fprintf(stderr, "Out of memory.\n"); exit(1); } } 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; } masqmail-0.3.4/src/readsock.h0000644000000000000000000000177311705501561016230 0ustar00usergroup00000000000000/* ** 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); masqmail-0.3.4/src/readtest.c0000644000000000000000000000053511705501561016236 0ustar00usergroup00000000000000#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; } masqmail-0.3.4/src/resolvtest.c0000644000000000000000000000402011705501561016626 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) Oliver Kurth, ** Copyright (C) 2010 markus schnalke ** ** 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" masqmail_conf conf; 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[]) { GList *addr_list = NULL, *node; conf.debug_level = -1; /* no debug messages */ if (argc != 2) { fprintf(stderr, "usage: resolvtest HOSTNAME\n"); return 1; } if (res_init() != 0) { printf("res_init() failed.\n"); return 1; } printf("A:\n"); addr_list = resolve_dns_a(NULL, argv[1]); foreach(addr_list, node) { mxip_addr *p_mxip = (mxip_addr *) (node->data); printf("%s \t%s\n", p_mxip->name, inet_ntoa(*(struct in_addr *) &(p_mxip->ip))); } printf("\nMX:\n"); addr_list = resolve_dns_mx(NULL, argv[1]); foreach(addr_list, node) { mxip_addr *p_mxip = (mxip_addr *) (node->data); printf("%s \t%s %d\n", p_mxip->name, inet_ntoa(*(struct in_addr *) &(p_mxip->ip)), p_mxip->pref); } printf("\nIP resolved directly (assumed FQDN, no default domain added):\n"); { guint32 ip; if (dns_look_ip(argv[1], &ip) >= 0) { printf("%s\n", inet_ntoa(*((struct in_addr *) (&ip)))); } } return 0; } masqmail-0.3.4/src/rewrite.c0000644000000000000000000000507011705501561016103 0ustar00usergroup00000000000000/* ** 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; gchar *loc_beg, *loc_end; gchar *dom_beg, *dom_end; gchar *addr_end; gchar *rewr_string; gchar *left, *right; while (*p) { if (!parse_address_rfc822(p, &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end)) { return FALSE; } if (dom_beg) { 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); } 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) { did_change = TRUE; } else { rewr_string = addr->address; } 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; } masqmail-0.3.4/src/route.c0000644000000000000000000003346511705501561015571 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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 "masqmail.h" 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"); } /* ** Split a recipient list into the three groups: ** - local recipients ** - those maching the patterns ** - those not matching the patterns ** If patterns is NULL: only splitting between local and others is done. */ void split_rcpts(GList *rcpt_list, GList *patterns, GList **rl_local, GList **rl_matching, GList **rl_others) { GList *rcpt_node; GList *pat_node = NULL; address *rcpt = NULL; if (rcpt_list == NULL) return; foreach(rcpt_list, rcpt_node) { rcpt = (address *) (rcpt_node->data); pat_node = NULL; if (addr_is_local(rcpt)) { if (rl_local) *rl_local = g_list_append(*rl_local, rcpt); } else { /* ** if patterns is NULL, pat_node will be NULL, ** hence all non-locals are put to others */ foreach(patterns, pat_node) { address *pat = (address *) (pat_node->data); if (fnmatch(pat->domain, rcpt->domain, FNM_CASEFOLD)==0 && fnmatch(pat->local_part, rcpt->local_part, 0)==0) { /* TODO: match local_part caseless? */ break; } } if (pat_node) { if (rl_matching) *rl_matching = g_list_append(*rl_matching, rcpt); } else { if (rl_others) *rl_others = g_list_append(*rl_others, rcpt); } } } } /* ** Return a new list of the local rcpts in the rcpt_list ** TODO: This function is almost exactly the same as remote_rcpts(). Merge? */ GList* local_rcpts(GList *rcpt_list) { GList *rcpt_node; GList *local_rcpts = NULL; address *rcpt = NULL; if (!rcpt_list) { return NULL; } foreach(rcpt_list, rcpt_node) { rcpt = (address *) (rcpt_node->data); if (addr_is_local(rcpt)) { local_rcpts = g_list_append(local_rcpts, rcpt); } } return local_rcpts; } /* ** Return a new list of non-local rcpts in the rcpt_list ** TODO: This function is almost exactly the same as local_rcpts(). Merge? */ GList* remote_rcpts(GList *rcpt_list) { GList *rcpt_node; GList *remote_rcpts = NULL; address *rcpt = NULL; if (!rcpt_list) { return NULL; } foreach(rcpt_list, rcpt_node) { rcpt = (address *) (rcpt_node->data); if (!addr_is_local(rcpt)) { remote_rcpts = g_list_append(remote_rcpts, rcpt); } } return remote_rcpts; } static gint _g_list_addrcmp(gconstpointer pattern, gconstpointer addr) { int res; address *patternaddr = (address*) pattern; address *stringaddr = (address*) addr; DEBUG(6) debugf("_g_list_addrcmp: pattern `%s' `%s' on string `%s' `%s'\n", patternaddr->local_part, patternaddr->domain, stringaddr->local_part, stringaddr->domain); /* TODO: check if we should match here dependent on caseless_matching */ res = fnmatch(patternaddr->local_part, stringaddr->local_part, 0); if (res != 0) { DEBUG(6) debugf("_g_list_addrcmp: ... failed on local_part\n"); return res; } res = fnmatch(patternaddr->domain, stringaddr->domain, FNM_CASEFOLD); DEBUG(6) debugf("_g_list_addrcmp: ... %s\n", (res==0) ? "matched" : "failed on domain"); return res; } gboolean route_sender_is_allowed(connect_route *route, address *ret_path) { if (route->denied_senders && g_list_find_custom(route->denied_senders, ret_path, _g_list_addrcmp)) { return FALSE; } if (route->allowed_senders) { if (g_list_find_custom(route->allowed_senders, ret_path, _g_list_addrcmp)) { 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 route_split_rcpts(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_recipients) { DEBUG(5) debugf("testing for route->allowed_recipients\n"); split_rcpts(rcpt_list, route->allowed_recipients, NULL, &tmp_list, p_non_rcpt_list); } else { DEBUG(5) debugf("route->allowed_recipients == NULL\n"); tmp_list = g_list_copy(rcpt_list); } /* sort out those domains that cannot be sent over this connection: */ split_rcpts(tmp_list, route->denied_recipients, NULL, 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; } masqmail-0.3.4/src/smtp_in.c0000644000000000000000000002342611705501561016100 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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) */ 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; } static gboolean get_size(gchar *line, unsigned long *msize) { gchar *s = NULL; /* hope we need not to handle cases like SiZe= ...*/ s = strstr(line, "SIZE="); if (!s) { /* try it in lowercase too */ if (!(s = strstr(line, "size="))) { return FALSE; } } s += 5; *msize = atol(s); DEBUG(5) debugf("get_size(): line=%s, msize=%ld\n", line, *msize); return TRUE; } /* ** this is a quick hack: we expect the address to be syntactically correct ** and containing the mailbox only, though we first check for size in ** smtp_in(). ** Return false if address is too long. */ static gboolean get_address(gchar *line, gchar *addr) { gchar *p = line; gchar *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)) { if (q >= addr + MAX_ADDRESS-1) { *q = '\0'; return FALSE; } *(q++) = *(p++); } *q = '\0'; return TRUE; } static smtp_connection* create_base(gchar *remote_host) { smtp_connection *base = g_malloc(sizeof(smtp_connection)); if (!base) { return NULL; } 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; } 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\n", 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; unsigned long msize; 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) { /* this check is actually unneccessary as g_malloc() aborts on failure */ return; } /* 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); if (conf.defer_all) { /* I need this to debug delivery failures */ smtp_printf(out, "421 %s service temporarily unavailable.\r\n", conf.host_name); destroy_message(msg); msg = NULL; return; } switch (cmd_id) { case SMTP_HELO: psc->prot = PROT_SMTP; psc->helo_seen = TRUE; smtp_printf(out, "250 %s pretty old mailer, huh?\r\n", conf.host_name); break; case SMTP_EHLO: psc->prot = PROT_ESMTP; psc->helo_seen = TRUE; smtp_printf(out, "250-%s Nice to meet you with ESMTP\r\n", conf.host_name); smtp_printf(out, "250-SIZE %d\r\n", conf.max_msg_size); smtp_printf(out, "250-PIPELINING\r\n"); smtp_printf(out, "250 HELP\r\n"); break; case SMTP_MAIL_FROM: { gchar buf[MAX_ADDRESS]; address *addr; if (!psc->helo_seen) { smtp_printf(out, "503 need HELO or EHLO\r\n"); break; } if (psc->from_seen) { smtp_printf(out, "503 MAIL FROM: already given.\r\n"); break; } if (get_size(buffer, &msize)) { DEBUG(5) debugf("smtp_in(): get_size: msize=%ld, conf.mms=%d\n", msize, conf.max_msg_size); if (conf.max_msg_size && (msize > conf.max_msg_size)) { smtp_printf(out, "552 Message size exceeds fixed limit.\r\n"); break; } } if (!get_address(buffer, buf)) { smtp_printf(out, "553 Address too long.\r\n"); break; } 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)++; if (remote_host) { addr = create_address(buf, TRUE); } else { addr = create_address_qualified(buf, TRUE, conf.host_name); } if (!addr) { smtp_printf(out, "501 %s: syntax error.\r\n", buf); } else if (!addr->domain) { smtp_printf(out, "501 return path must be qualified.\r\n", buf); } else { psc->from_seen = TRUE; msg->return_path = addr; smtp_printf(out, "250 OK %s is a nice guy.\r\n", addr->address); } } break; case SMTP_RCPT_TO: { char buf[MAX_ADDRESS]; address *addr; if (!psc->helo_seen) { smtp_printf(out, "503 need HELO or EHLO.\r\n"); break; } if (!psc->from_seen) { smtp_printf(out, "503 need MAIL FROM: before RCPT TO:\r\n"); break; } if (!get_address(buffer, buf)) { smtp_printf(out, "553 Address too long.\r\n"); break; } if (remote_host) { addr = create_address(buf, TRUE); } else { addr = create_address_qualified(buf, TRUE, conf.host_name); } if (!addr) { smtp_printf(out, "501 %s: syntax error in address.\r\n", buf); break; } if (addr->local_part[0] == '|') { smtp_printf(out, "501 %s: no pipe allowed for SMTP connections\r\n", buf); break; } if (!addr->domain) { /* TODO: ``postmaster'' may be unqualified */ smtp_printf(out, "501 recipient address must be qualified.\r\n", buf); break; } if (!(conf.do_relay || addr_is_local(msg->return_path) || addr_is_local(addr))) { smtp_printf(out, "550 relaying to %s denied.\r\n", addr_string(addr)); break; } 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); } break; case SMTP_DATA: if (!psc->helo_seen) { smtp_printf(out, "503 need HELO or EHLO.\r\n"); break; } if (!psc->rcpt_seen) { smtp_printf(out, "503 need RCPT TO: before DATA\r\n"); break; } accept_error err; smtp_printf(out, "354 okay, and do not forget the dot\r\n"); err = accept_message(in, msg, conf.do_save_envelope_to ? ACC_SAVE_ENVELOPE_TO : 0); if (err != AERR_OK) { switch (err) { case AERR_TIMEOUT: case AERR_EOF: return; case AERR_SIZE: smtp_printf(out, "552 Error: message too large.\r\n"); return; default: /* should never happen: */ smtp_printf(out, "451 Unknown error\r\n"); return; } } if (!spool_write(msg, TRUE)) { smtp_printf(out, "451 Could not write spool file\r\n"); return; } 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) { DEBUG(1) debugf("queuing forced by configuration or option.\n"); } else { pid = fork(); if (pid < 0) { logwrite(LOG_ALERT, "could not fork for delivery, id = %s\n", msg->uid); } else if (pid == 0) { /* FIXME: most likely inverted exit code */ _exit(deliver(msg)); } } psc->rcpt_seen = psc->from_seen = FALSE; destroy_message(msg); msg = NULL; break; case SMTP_QUIT: smtp_printf(out, "221 goodbye\r\n"); destroy_message(msg); msg = NULL; return; case SMTP_RSET: psc->from_seen = psc->rcpt_seen = FALSE; 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; } } masqmail-0.3.4/src/smtp_out.c0000644000000000000000000005626611705501561016311 0ustar00usergroup00000000000000/* ** smtp_out.c ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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. */ /* ** 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 #include "md5/md5.h" #include "md5/hmac_md5.h" #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_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] == '-'); if (psb->buffer) { DEBUG(4) debugf("S: %s\n", psb->buffer); } 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_data = %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_data = %d\n", psb->buffer, (int) after_data); 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; if (!check_response(psb, FALSE)) return FALSE; if (psb->last_code == 220) { logwrite(LOG_NOTICE, "received a 220 greeting after sending EHLO,\n"); logwrite(LOG_NOTICE, "please remove `instant_helo' from your route config\n"); /* read the next response, cause that's the actual helo response */ if (!read_response(psb, SMTP_CMD_TIMEOUT) || !check_response(psb, FALSE)) { return FALSE; } } ptr = psb->buffer; 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; debugf("in check_helo_response()\n"); while (psb->auth_names[i]) { debugf(" offered AUTH %s\n", psb->auth_names[i]); i++; } } } } } while (*ptr != '\n') ptr++; ptr++; } DEBUG(4) { debugf(" %s\n", psb->use_size ? "uses SIZE" : "no size"); debugf(" %s\n", psb->use_pipelining ? "uses PIPELINING" : "no pipelining"); debugf(" %s\n", psb->use_auth ? "uses AUTH" : "no auth"); } return TRUE; } /* ** We first try EHLO, but if it fails HELO in a second fall back try. ** This is what is requested by RFC 2821 (sec 3.2): ** ** Once the server has sent the welcoming message and ** the client has received it, the client normally sends ** the EHLO command to the server, [...] ** For a particular connection attempt, if the server ** returns a "command not recognized" response to EHLO, ** the client SHOULD be able to fall back and send HELO. ** ** Up to and including version 0.3.0 masqmail used ESMTP only if the ** string ``ESMTP'' appeared within the server's greeting message. This ** made it impossible to use AUTH with servers that would send odd ** greeting messages. */ static gboolean smtp_helo(smtp_base *psb, gchar *helo) { fprintf(psb->out, "EHLO %s\r\n", helo); fflush(psb->out); DEBUG(4) debugf("C: EHLO %s\r\n", helo); if (!read_response(psb, SMTP_CMD_TIMEOUT)) { return FALSE; } if (check_helo_response(psb)) { DEBUG(4) debugf("uses esmtp\n"); return TRUE; } if (psb->error != smtp_fail) { return FALSE; } /* ** our guess that server understands EHLO could have been wrong, ** try again with HELO */ fprintf(psb->out, "HELO %s\r\n", helo); fflush(psb->out); DEBUG(4) debugf("C: HELO %s\r\n", helo); if (!read_response(psb, SMTP_CMD_TIMEOUT)) { return FALSE; } if (check_helo_response(psb)) { DEBUG(4) debugf("uses smtp\n"); return TRUE; } /* what sort of server ist THAT ?! give up... */ 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("C: 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("C: 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("C: 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 == '.' && new_line) { /* dot-stuffing */ putc('.', psb->out); } if (c == '\n') { /* CRLF line terminators */ 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); DEBUG(4) debugf("C: .\n"); } 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) { return NULL; } psb = create_smtpbase(sock); psb->remote_host = NULL; return psb; } gboolean smtp_out_rset(smtp_base *psb) { gboolean ok; fprintf(psb->out, "RSET\r\n"); fflush(psb->out); DEBUG(4) debugf("C: 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, "C: 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; DEBUG(5) debugf("smtp_out_auth_cram_md5():\n"); 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); hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest); 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(6) debugf(" reply64 = %s\n", reply64); DEBUG(6) debugf("C: %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); DEBUG(4) debugf("C: AUTH LOGIN\r\n"); if ((ok = read_response(psb, SMTP_CMD_TIMEOUT))) { if ((ok = check_response(psb, TRUE))) { gchar *resp64; guchar *resp; gint resp_size; gchar *reply64; DEBUG(5) debugf("smtp_out_auth_login():\n"); 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); DEBUG(6) debugf("C: %s\n", reply64); 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); DEBUG(6) debugf("C: %s\n", reply64); 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 instant_helo) { gboolean ok; logwrite(LOG_INFO, "smtp_out_init(): instant_helo:%d\n", instant_helo); if (!instant_helo) { if ((ok = read_response(psb, SMTP_INITIAL_TIMEOUT))) { ok = check_response(psb, FALSE); } if (!ok) { smtp_out_log_failure(psb, NULL); return ok; } } 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) { /* ** pretend the message is a bit larger, ** just in case the size calculation is buggy */ 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\n", 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("C: 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\n", 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("smtp_out_msg():\n"); 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\n", msg->uid, addr_string(rcpt), psb->remote_host); } } 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("C: 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, FALSE)) { 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; } masqmail-0.3.4/src/smtp_out.h0000644000000000000000000000502111705501561016275 0ustar00usergroup00000000000000/* ** 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 /* add to the size of a message */ #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_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, gboolean instant_helo); 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); void smtp_out_mark_rcpts(smtp_base *psb, GList *rcpt_list); gint smtp_deliver(gchar *host, gint port, GList *resolve_list, message *msg, address *return_path, GList *rcpt_list); masqmail-0.3.4/src/smtpsend.c0000644000000000000000000000475211705501561016265 0ustar00usergroup00000000000000/* ** 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_DOT_IGNORE)) == AERR_OK) { if ((ret = smtp_deliver(server_name, server_port, resolve_list, msg, NULL, NULL)) == smtp_ok) { exit(0); } 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); } } masqmail-0.3.4/src/spool.c0000644000000000000000000002660211705501561015562 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2010 markus schnalke ** ** 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 "masqmail.h" #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) { buf[buf_len-1] = '\0'; ungetc(c, in); return buf_len; } 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; 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); in = fopen(spool_file, "r"); if (!in) { logwrite(LOG_ALERT, "could not open spool data file %s: %s\n", spool_file, strerror(errno)); return FALSE; } 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); return TRUE; } gboolean spool_read_header(message *msg) { FILE *in; gchar *spool_file; /* header spool: */ spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid); in = fopen(spool_file, "r"); if (!in) { logwrite(LOG_ALERT, "could not open spool header file %s: %s\n", spool_file, strerror(errno)); return FALSE; } 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->non_rcpt_list = g_list_append(msg->non_rcpt_list, addr); } else { msg->rcpt_list = g_list_append(msg->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) { DEBUG(6) debugf("spool_read_header(): hdr start\n"); hdr = get_header(&(buf[3])); msg->hdr_list = g_list_append(msg->hdr_list, hdr); } else if ((buf[0] == ' ' || buf[0] == '\t') && hdr) { DEBUG(6) debugf("spool_read_header(): hdr continuation\n"); char *tmp = hdr->header; /* header continuation */ hdr->header = g_strconcat(hdr->header, buf, NULL); hdr->value = hdr->header + (hdr->value - tmp); free(tmp); /* because g_strconcat() allocs and copies */ } else { break; } } fclose(in); return TRUE; } message* msg_spool_read(gchar *uid) { message *msg; gboolean ok = FALSE; msg = create_message(); msg->uid = g_strdup(uid); DEBUG(4) debugf("msg_spool_read():\n"); /* header spool: */ ok = spool_read_header(msg); DEBUG(4) debugf(" spool_read_header() returned: %d\n", ok); 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 && 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; } masqmail-0.3.4/src/tables.c0000644000000000000000000000636111705501561015700 0ustar00usergroup00000000000000/* ** MasqMail ** Copyright (C) 1999-2001 Oliver Kurth ** Copyright (C) 2008 markus schnalke ** ** 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 "masqmail.h" 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); if (!list) logwrite(LOG_NOTICE, "table file %s contained no entries\n", fname); return list; } logwrite(LOG_ALERT, "could not open table file %s: %s." " Thus no aliasing will be done\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); } masqmail-0.3.4/src/timeival.c0000644000000000000000000000237011705501561016234 0ustar00usergroup00000000000000/* ** 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) { gchar buf[16]; gchar *p = str, *q = buf; gint factor = 1, val; while (*p && isdigit(*p) && (q < buf+sizeof(buf)-1)) { *(q++) = *(p++); } *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; } masqmail-0.3.4/tests/README0000644000000000000000000000170511705501561015512 0ustar00usergroup00000000000000This directory contains test cases for masqmail, one in each directory. Build the test scripts be running make in the directory. You can build all of them by running make in the tests directory. Run the test by executing ./test in its directory, preferably NOT as root, but you got to have write permission for the directory. Usually, two log files, masqmail.log and debug.log, will be created. They may give some information if anything went wrong. The README files in the test case directories explain the tests in more detail. FIXME: Currently, the return values of the test scripts don't express if the test was successful or not. If tests 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 :-). The original test scripts are by oku. They were rearranged and extended by meillo. masqmail-0.3.4/tests/hostname-stdin/README0000644000000000000000000000061411705501561020445 0ustar00usergroup00000000000000Test hostname-stdin ------------------- Sends three mails, using different options, to . The mails are passed on stdin. Two log files, masqmail.log and debug.log will also be created within this directory. They may give some information if anything went wrong. Run them from within this directory, preferably NOT as root, but you got to have write permission for this directory. masqmail-0.3.4/tests/hostname-stdin/makefile0000644000000000000000000000066011705501561021266 0ustar00usergroup00000000000000# Makefile by markus schnalke # heavily based on Makefile.am written by oliver kurth all: test test.conf mkdir -p ./input ./lock test.conf: test.conf.tpl # fails if the current path contains `^'. sed "s/SMTP_HOST/`hostname`/; s^PWD^`pwd`^" $< >$@ test: test.tpl sed s/RECV_HOST/`hostname`/ $< >$@ chmod +x $@ clean: rm -f test.conf test realclean: clean rm -rf ./input ./lock rm -f *.log $(LOGNAME) masqmail-0.3.4/tests/hostname-stdin/test.conf.tpl0000644000000000000000000000112311705501561022205 0ustar00usergroup00000000000000# running as user is enough for testing purposes run_as_user=true # set debug level (0 = no debugging, 5 = very much, 6 = too much) debug_level = 5 # deliver at once do_queue = false # host_name="SMTP_HOST" # we want to deliver a message to `hostname` local_hosts="SMTP_HOST" # spool into the current directory spool_dir="PWD" # deliver local mail into the current directory mail_dir="PWD" # log into the current directory use_syslog=false log_dir="PWD" # relative names to the warn/failure template files errmsg_file="PWD/../../tpl/failmsg.tpl" warnmsg_file="PWD/../../tpl/warnmsg.tpl" masqmail-0.3.4/tests/hostname-stdin/test.tpl0000644000000000000000000000170211705501561021264 0ustar00usergroup00000000000000#!/bin/sh # path to the masqmail executable mm_bin=../../src/masqmail hfrom="\"Fritz Meier\" <$LOGNAME@RECV_HOST>" hto="$hfrom" to=$LOGNAME@RECV_HOST hsubject="Masqmail test: hostname-stdin" # Testing with rcpt on cmd line # (dot does end) # # the command to be run: cmd="$mm_bin -C ./test.conf $to" $cmd <. 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. Two log files, masqmail.log and debug.log will also be created within this directory. They may give some information if anything went wrong. Run them from within this directory, preferably NOT as root, but you got to have write permission for this directory. masqmail-0.3.4/tests/localhost-stdin/makefile0000644000000000000000000000054511705501561021442 0ustar00usergroup00000000000000# Makefile by markus schnalke # heavily based on Makefile.am written by oliver kurth all: test.conf mkdir -p ./input ./lock test.conf: test.conf.tpl # fails if the current path contains `^'. sed "s/SMTP_HOST/`hostname`/; s^PWD^`pwd`^" $< >$@ clean: rm -f test.conf realclean: clean rm -rf ./input ./lock rm -f *.log $(LOGNAME) masqmail-0.3.4/tests/localhost-stdin/test0000755000000000000000000000170211705501561020643 0ustar00usergroup00000000000000#!/bin/sh # path to the masqmail executable mm_bin=../../src/masqmail hfrom="\"Fritz Meier\" <$LOGNAME@localhost>" hto=$hfrom to=$LOGNAME@localhost hsubject="Masqmail test: localhost-stdin" # Testing with rcpt on cmd line # (dot does end) # # the command to be run: cmd="$mm_bin -C ./test.conf $to" $cmd <test masqmail-0.3.4/tests/relay-to-hostname-mta/makefile0000644000000000000000000000076511705501561022466 0ustar00usergroup00000000000000# Makefile by markus schnalke # heavily based on Makefile.am written by oliver kurth all: test test.conf test.route mkdir -p ./input ./lock test.conf: test.conf.tpl # fails if the current path contains `^'. sed "s^PWD^`pwd`^" $< >$@ test: test.tpl sed s/RECV_HOST/`hostname`/ $< >$@ chmod +x $@ test.route: echo mail_host=\"`hostname`\" >$@ echo "resolve_list = byname" >>$@ clean: rm -f test.conf test test.route realclean: clean rm -rf ./input ./lock rm -f *.log masqmail-0.3.4/tests/relay-to-hostname-mta/test.conf.tpl0000644000000000000000000000160511705501561023404 0ustar00usergroup00000000000000# running as user is enough for testing purposes run_as_user=true # set debug level (0 = no debugging, 5 = very much, 6 = too much) debug_level = 5 # deliver at once do_queue = false # identify with some name that is *not* the one of the our machine # maybe we should not define a name at all, but this may lead to # problems. Could be we even need a FQDN here. host_name="MASQMAIL-TEST" # we want to deliver through a route named `test' to a local MTA # thus we do not define any hosts as local. All mail should go through # the route. permanent_routes = "PWD/test.route" # spool files in the current directory spool_dir="PWD" # deliver local mails into the current directory mail_dir="PWD" # log into the current directory use_syslog=false log_dir="PWD" # relative paths to the warn/failure message templates errmsg_file="PWD/../../tpl/failmsg.tpl" warnmsg_file="PWD/../../tpl/warnmsg.tpl" masqmail-0.3.4/tests/relay-to-hostname-mta/test.tpl0000644000000000000000000000171111705501561022456 0ustar00usergroup00000000000000#!/bin/sh # path to the masqmail executable mm_bin=../../src/masqmail hfrom="\"Fritz Meier\" <$LOGNAME@RECV_HOST>" hto="$hfrom" to=$LOGNAME@RECV_HOST hsubject="Masqmail test: relay-to-hostname-mta" # Testing with rcpt on cmd line # (dot does end) # # the command to be run: cmd="$mm_bin -C ./test.conf $to" $cmd <test masqmail-0.3.4/tests/relay-to-localhost-mta/makefile0000644000000000000000000000061411705501561022631 0ustar00usergroup00000000000000# Makefile by markus schnalke # heavily based on Makefile.am written by oliver kurth all: test test.conf mkdir -p ./input ./lock test.conf: test.conf.tpl # fails if the current path contains `^'. sed "s^PWD^`pwd`^" $< >$@ test: test.tpl sed s/RECV_HOST/`hostname`/ $< >$@ chmod +x $@ clean: rm -f test.conf test realclean: clean rm -rf ./input ./lock rm -f *.log masqmail-0.3.4/tests/relay-to-localhost-mta/test.conf.tpl0000644000000000000000000000160511705501561023556 0ustar00usergroup00000000000000# running as user is enough for testing purposes run_as_user=true # set debug level (0 = no debugging, 5 = very much, 6 = too much) debug_level = 5 # deliver at once do_queue = false # identify with some name that is *not* the one of the our machine # maybe we should not define a name at all, but this may lead to # problems. Could be we even need a FQDN here. host_name="MASQMAIL-TEST" # we want to deliver through a route named `test' to a local MTA # thus we do not define any hosts as local. All mail should go through # the route. permanent_routes = "PWD/test.route" # spool files in the current directory spool_dir="PWD" # deliver local mails into the current directory mail_dir="PWD" # log into the current directory use_syslog=false log_dir="PWD" # relative paths to the warn/failure message templates errmsg_file="PWD/../../tpl/failmsg.tpl" warnmsg_file="PWD/../../tpl/warnmsg.tpl" masqmail-0.3.4/tests/relay-to-localhost-mta/test.route0000644000000000000000000000005611705501561023170 0ustar00usergroup00000000000000mail_host = "localhost" resolve_list = byname masqmail-0.3.4/tests/relay-to-localhost-mta/test.tpl0000644000000000000000000000171211705501561022631 0ustar00usergroup00000000000000#!/bin/sh # path to the masqmail executable mm_bin=../../src/masqmail hfrom="\"Fritz Meier\" <$LOGNAME@RECV_HOST>" hto="$hfrom" to=$LOGNAME@RECV_HOST hsubject="Masqmail test: relay-to-localhost-mta" # 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}-- masqmail-0.3.4/tpl/failmsg.tpl.de0000644000000000000000000000265311705501561017024 0ustar00usergroup00000000000000Subject: 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}-- masqmail-0.3.4/tpl/failmsg.tpl.fr0000644000000000000000000000266311705501561017044 0ustar00usergroup00000000000000Subject: 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}-- masqmail-0.3.4/tpl/failmsg.tpl.it0000644000000000000000000000262411705501561017046 0ustar00usergroup00000000000000From: 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 - rimosso] ([message body - stripped off]) --${uid}/${host_name}-- masqmail-0.3.4/tpl/warnmsg.tpl0000644000000000000000000000176511705501561016474 0ustar00usergroup00000000000000Subject: 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}-- masqmail-0.3.4/tpl/warnmsg.tpl.de0000644000000000000000000000315711705501561017060 0ustar00usergroup00000000000000Subject: 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}-- masqmail-0.3.4/tpl/warnmsg.tpl.fr0000644000000000000000000000363111705501561017074 0ustar00usergroup00000000000000Subject: 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}-- masqmail-0.3.4/tpl/warnmsg.tpl.it0000644000000000000000000000303511705501561017077 0ustar00usergroup00000000000000Subject: 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}" Messaggio in formato MIME multi-parti. This is a MIME-encapsulated message. --${uid}/${host_name} Content-Description: Notification Content-Type: text/plain Questo messaggio ti e' stato spedito dal servente: ${package} ${version}) a ${host_name}. (This message was sent to you by the mailer daemon: ${package} ${version}) at ${host_name}.) Spiacente ma non e' stato possibile spedire il tuo msg a tutti i destinatari. L'invio ai seguenti destinatari e' stato ritardato: (Sorry, but your mail could not yet be delivered to all recipients. Delivery to the following recipients has been defered:) @failed_rcpts La spedizione verra' ritentata, finche' ha successo o scade il tempo disponibile impostato. In quest'ultimo caso riceverai una notifica di spedizione fallita definitiva. (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.) 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 delay:) ${err_msg} In caso ti serva aiuto scrivi a: (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}--