Codebase list libetpan / 3c4170b
Import Debian changes 0.39.1-1 libetpan (0.39.1-1) unstable; urgency=low * New upstream release (Closes: #329202). * Increased version in shlibs file, because of API_CURRENT increase. * Bump Standards-Version to 3.6.2, no changes needed. Nikita V. Youshchenko authored 18 years ago Ricardo Mones committed 5 years ago
68 changed file(s) with 1597 addition(s) and 518 deletion(s). Raw diff Collapse all Expand all
0 2005-09-16 - libetpan-0.39 - hoa
1
2 * release 0.39 - Deliverance
3 compatibility with GnuTLS
4 SASL for higher level
5
6 2005-09-12 - libetpan-0.38cvs5 - colin
7
8 * src/data-types/mailstream_ssl.c
9 fixed compatibility with GnuTLS.
10
11 2005-08-17 - libetpan-0.38cvs4 - hoa
12
13 * src/engine/mailprivacy_smime.c
14 fixed crash when a S/MIME 2 signed message does not verify.
15
16 2005-08-14 - libetpan-0.38cvs3 - hoa
17
18 * src/driver/implementation/db/dbdriver.c
19 * src/driver/implementation/imap/imapdriver.c
20 * src/driver/implementation/imap/imapdriver_cached.c
21 * src/driver/implementation/imap/imapdriver_types.h
22 * src/driver/implementation/imap/imapstorage.c
23 * src/driver/implementation/imap/imapstorage.h
24 * src/driver/implementation/maildir/maildirdriver.c
25 * src/driver/implementation/maildir/maildirdriver_cached.c
26 * src/driver/implementation/mbox/mboxdriver.c
27 * src/driver/implementation/mbox/mboxdriver_cached.c
28 * src/driver/implementation/mh/mhdriver.c
29 * src/driver/implementation/mh/mhdriver_cached.c
30 * src/driver/implementation/nntp/nntpdriver.c
31 * src/driver/implementation/nntp/nntpdriver_cached.c
32 * src/driver/implementation/pop3/pop3driver.c
33 * src/driver/implementation/pop3/pop3driver_cached.c
34 * src/driver/implementation/pop3/pop3driver_types.h
35 * src/driver/implementation/pop3/pop3storage.c
36 * src/driver/implementation/pop3/pop3storage.h
37 * src/driver/interface/maildriver.c
38 * src/driver/interface/maildriver.h
39 * src/driver/interface/maildriver_types.h
40 * src/driver/interface/mailstorage_tools.c
41 * src/driver/interface/mailstorage_tools.h
42 implemented SASL at higher level API.
43
44 * src/engine/mailprivacy_smime.c
45 support for Outlook signed messages.
46
47 2005-08-13 - libetpan-0.38cvs2 - hoa
48
49 * src/data-types/mailstream.c
50 * src/data-types/mailstream_socket.c
51 * src/data-types/mailstream_ssl.c
52 * src/driver/implementation/data-message/data_message_driver.c
53 * src/driver/implementation/db/dbdriver.c
54 * src/driver/implementation/db/dbdriver_message.c
55 * src/driver/implementation/db/dbstorage.c
56 * src/driver/implementation/imap/imapdriver.c
57 * src/driver/implementation/imap/imapdriver_cached.c
58 * src/driver/implementation/imap/imapdriver_cached_message.c
59 * src/driver/implementation/imap/imapdriver_message.c
60 * src/driver/implementation/imap/imapstorage.c
61 * src/driver/implementation/maildir/maildirdriver.c
62 * src/driver/implementation/maildir/maildirdriver_cached.c
63 * src/driver/implementation/maildir/maildirdriver_cached_message.c
64 * src/driver/implementation/maildir/maildirdriver_message.c
65 * src/driver/implementation/maildir/maildirstorage.c
66 * src/driver/implementation/mbox/mboxdriver.c
67 * src/driver/implementation/mbox/mboxdriver_cached.c
68 * src/driver/implementation/mbox/mboxdriver_cached_message.c
69 * src/driver/implementation/mbox/mboxdriver_message.c
70 * src/driver/implementation/mbox/mboxstorage.c
71 * src/driver/implementation/mh/mhdriver.c
72 * src/driver/implementation/mh/mhdriver_cached.c
73 * src/driver/implementation/mh/mhdriver_cached_message.c
74 * src/driver/implementation/mh/mhdriver_message.c
75 * src/driver/implementation/mh/mhstorage.c
76 * src/driver/implementation/mime-message/mime_message_driver.c
77 * src/driver/implementation/nntp/nntpdriver.c
78 * src/driver/implementation/nntp/nntpdriver_cached.c
79 * src/driver/implementation/nntp/nntpdriver_cached_message.c
80 * src/driver/implementation/nntp/nntpdriver_message.c
81 * src/driver/implementation/nntp/nntpstorage.c
82 * src/driver/implementation/pop3/pop3driver.c
83 * src/driver/implementation/pop3/pop3driver_cached.c
84 * src/driver/implementation/pop3/pop3driver_cached_message.c
85 * src/driver/implementation/pop3/pop3driver_message.c
86 * src/driver/implementation/pop3/pop3storage.c
87 * src/driver/interface/mailstorage_tools.c
88 * src/engine/mailprivacy_gnupg.c
89 * src/engine/mailprivacy_smime.c
90 fixed build on Solaris.
91 Thanks to Alex S. Moore.
92
93 2005-08-13 - libetpan-0.38cvs1 - hoa
94
95 * src/low-level/mbox/mailmbox.c
96 switched from LF to CRLF.
97 Thanks to Alfons Hoogervorst.
98
099 2005-07-20 - libetpan-0.38 - hoa
1100
2 * release 0.37 - Deadwing
101 * release 0.38 - Deadwing
3102
4103 * fixed SSL
5104 * IMAP improvements
0 2005-09-16 - libetpan-0.39 - hoa
1
2 * release 0.39 - Deliverance
3
4 * compatibility with GnuTLS
5 * SASL for higher level
6
07 2005-07-20 - libetpan-0.38 - hoa
18
2 * release 0.37 - Deadwing
9 * release 0.38 - Deadwing
310
411 * fixed SSL
512 * IMAP improvements
14971497
14981498
14991499 VERSION_MAJOR=0
1500 VERSION_MINOR=38
1501
1502 API_CURRENT=3
1500 VERSION_MINOR=39
1501
1502 API_CURRENT=4
15031503 API_REVISION=0
15041504 API_COMPATIBILITY=3
15051505
802802 Filter="h;hpp;hxx;hm;inl;inc;xsd"
803803 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
804804 <File
805 RelativePath="..\include\StdAfx.h">
805 RelativePath="..\libetpan-config.h">
806 </File>
807 <File
808 RelativePath="..\libetpan_version.h">
809 </File>
810 <File
811 RelativePath="..\StdAfx.h">
806812 </File>
807813 </Filter>
808814 <Filter
55 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readmsg", "readmsg\readmsg.vcproj", "{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}"
66 ProjectSection(ProjectDependencies) = postProject
77 {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
8 EndProjectSection
9 EndProject
10 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smtpsend", "smtpsend\smtpsend.vcproj", "{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
11 ProjectSection(ProjectDependencies) = postProject
812 EndProjectSection
913 EndProject
1014 Global
2125 {5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Debug.Build.0 = Debug|Win32
2226 {5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Release.ActiveCfg = Release|Win32
2327 {5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Release.Build.0 = Release|Win32
28 {FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Debug.ActiveCfg = Debug|Win32
29 {FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Debug.Build.0 = Debug|Win32
30 {FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Release.ActiveCfg = Release|Win32
31 {FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Release.Build.0 = Release|Win32
2432 EndGlobalSection
2533 GlobalSection(ExtensibilityGlobals) = postSolution
2634 EndGlobalSection
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="7.10"
4 Name="smtpsend"
5 ProjectGUID="{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
6 Keyword="Win32Proj">
7 <Platforms>
8 <Platform
9 Name="Win32"/>
10 </Platforms>
11 <Configurations>
12 <Configuration
13 Name="Debug|Win32"
14 OutputDirectory="Debug"
15 IntermediateDirectory="Debug"
16 ConfigurationType="1"
17 CharacterSet="2">
18 <Tool
19 Name="VCCLCompilerTool"
20 Optimization="0"
21 AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
22 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
23 MinimalRebuild="TRUE"
24 BasicRuntimeChecks="3"
25 RuntimeLibrary="3"
26 UsePrecompiledHeader="0"
27 WarningLevel="3"
28 Detect64BitPortabilityProblems="TRUE"
29 DebugInformationFormat="4"
30 CompileAs="1"
31 ForcedIncludeFiles="../../StdAfx.h"/>
32 <Tool
33 Name="VCCustomBuildTool"/>
34 <Tool
35 Name="VCLinkerTool"
36 AdditionalDependencies="libetpan.lib"
37 OutputFile="../Debug/smtpsend.exe"
38 LinkIncremental="2"
39 AdditionalLibraryDirectories="..\Debug"
40 IgnoreDefaultLibraryNames="C"
41 GenerateDebugInformation="TRUE"
42 ProgramDatabaseFile="$(OutDir)/smtpsend.pdb"
43 SubSystem="1"
44 TargetMachine="1"/>
45 <Tool
46 Name="VCMIDLTool"/>
47 <Tool
48 Name="VCPostBuildEventTool"/>
49 <Tool
50 Name="VCPreBuildEventTool"/>
51 <Tool
52 Name="VCPreLinkEventTool"/>
53 <Tool
54 Name="VCResourceCompilerTool"/>
55 <Tool
56 Name="VCWebServiceProxyGeneratorTool"/>
57 <Tool
58 Name="VCXMLDataGeneratorTool"/>
59 <Tool
60 Name="VCWebDeploymentTool"/>
61 <Tool
62 Name="VCManagedWrapperGeneratorTool"/>
63 <Tool
64 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
65 </Configuration>
66 <Configuration
67 Name="Release|Win32"
68 OutputDirectory="Release"
69 IntermediateDirectory="Release"
70 ConfigurationType="1"
71 CharacterSet="2">
72 <Tool
73 Name="VCCLCompilerTool"
74 AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
75 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
76 RuntimeLibrary="2"
77 UsePrecompiledHeader="0"
78 WarningLevel="3"
79 Detect64BitPortabilityProblems="TRUE"
80 DebugInformationFormat="0"
81 ForcedIncludeFiles="../StdAfx.h"/>
82 <Tool
83 Name="VCCustomBuildTool"/>
84 <Tool
85 Name="VCLinkerTool"
86 AdditionalDependencies="libetpan.lib"
87 OutputFile="../Release/smtpsend.exe"
88 LinkIncremental="1"
89 AdditionalLibraryDirectories="..\Release"
90 IgnoreDefaultLibraryNames="C"
91 GenerateDebugInformation="TRUE"
92 SubSystem="1"
93 OptimizeReferences="2"
94 EnableCOMDATFolding="2"
95 TargetMachine="1"/>
96 <Tool
97 Name="VCMIDLTool"/>
98 <Tool
99 Name="VCPostBuildEventTool"/>
100 <Tool
101 Name="VCPreBuildEventTool"/>
102 <Tool
103 Name="VCPreLinkEventTool"/>
104 <Tool
105 Name="VCResourceCompilerTool"/>
106 <Tool
107 Name="VCWebServiceProxyGeneratorTool"/>
108 <Tool
109 Name="VCXMLDataGeneratorTool"/>
110 <Tool
111 Name="VCWebDeploymentTool"/>
112 <Tool
113 Name="VCManagedWrapperGeneratorTool"/>
114 <Tool
115 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
116 </Configuration>
117 </Configurations>
118 <References>
119 </References>
120 <Files>
121 <Filter
122 Name="Source Files"
123 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
124 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
125 <File
126 RelativePath="..\..\src\bsd\getopt.c">
127 </File>
128 <File
129 RelativePath="..\..\src\bsd\getopt_long.c">
130 </File>
131 <File
132 RelativePath="..\..\tests\Makefile">
133 <FileConfiguration
134 Name="Debug|Win32"
135 ExcludedFromBuild="TRUE">
136 <Tool
137 Name="VCCustomBuildTool"/>
138 </FileConfiguration>
139 <FileConfiguration
140 Name="Release|Win32"
141 ExcludedFromBuild="TRUE">
142 <Tool
143 Name="VCCustomBuildTool"/>
144 </FileConfiguration>
145 </File>
146 <File
147 RelativePath="..\..\tests\smtpsend.c">
148 </File>
149 </Filter>
150 <Filter
151 Name="Header Files"
152 Filter="h;hpp;hxx;hm;inl;inc;xsd"
153 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
154 </Filter>
155 <Filter
156 Name="Resource Files"
157 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
158 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
159 </Filter>
160 </Files>
161 <Globals>
162 </Globals>
163 </VisualStudioProject>
22 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
33 # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
44
5 timestamp='2005-04-22'
5 timestamp='2005-08-03'
66
77 # This file is free software; you can redistribute it and/or modify it
88 # under the terms of the GNU General Public License as published by
1616 #
1717 # You should have received a copy of the GNU General Public License
1818 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
20 # 02110-1301, USA.
2021 #
2122 # As a special exception to the GNU General Public License, if you
2223 # distribute this file as part of a program that contains a
2324 # configuration script generated by Autoconf, you may include it under
2425 # the same distribution terms that you use for the rest of that program.
26
2527
2628 # Originally written by Per Bothner <per@bothner.com>.
2729 # Please send patches to <config-patches@gnu.org>. Submit a context
6567 while test $# -gt 0 ; do
6668 case $1 in
6769 --time-stamp | --time* | -t )
68 echo "$timestamp" ; exit 0 ;;
70 echo "$timestamp" ; exit ;;
6971 --version | -v )
70 echo "$version" ; exit 0 ;;
72 echo "$version" ; exit ;;
7173 --help | --h* | -h )
72 echo "$usage"; exit 0 ;;
74 echo "$usage"; exit ;;
7375 -- ) # Stop option processing
7476 shift; break ;;
7577 - ) # Use stdin as input.
122124 ;;
123125 ,,*) CC_FOR_BUILD=$CC ;;
124126 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
125 esac ;'
127 esac ; set_cc_for_build= ;'
126128
127129 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
128130 # (ghazi@noc.rutgers.edu 1994-08-24)
195197 # contains redundant information, the shorter form:
196198 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
197199 echo "${machine}-${os}${release}"
198 exit 0 ;;
199 amd64:OpenBSD:*:*)
200 echo x86_64-unknown-openbsd${UNAME_RELEASE}
201 exit 0 ;;
202 amiga:OpenBSD:*:*)
203 echo m68k-unknown-openbsd${UNAME_RELEASE}
204 exit 0 ;;
205 cats:OpenBSD:*:*)
206 echo arm-unknown-openbsd${UNAME_RELEASE}
207 exit 0 ;;
208 hp300:OpenBSD:*:*)
209 echo m68k-unknown-openbsd${UNAME_RELEASE}
210 exit 0 ;;
211 luna88k:OpenBSD:*:*)
212 echo m88k-unknown-openbsd${UNAME_RELEASE}
213 exit 0 ;;
214 mac68k:OpenBSD:*:*)
215 echo m68k-unknown-openbsd${UNAME_RELEASE}
216 exit 0 ;;
217 macppc:OpenBSD:*:*)
218 echo powerpc-unknown-openbsd${UNAME_RELEASE}
219 exit 0 ;;
220 mvme68k:OpenBSD:*:*)
221 echo m68k-unknown-openbsd${UNAME_RELEASE}
222 exit 0 ;;
223 mvme88k:OpenBSD:*:*)
224 echo m88k-unknown-openbsd${UNAME_RELEASE}
225 exit 0 ;;
226 mvmeppc:OpenBSD:*:*)
227 echo powerpc-unknown-openbsd${UNAME_RELEASE}
228 exit 0 ;;
229 sgi:OpenBSD:*:*)
230 echo mips64-unknown-openbsd${UNAME_RELEASE}
231 exit 0 ;;
232 sun3:OpenBSD:*:*)
233 echo m68k-unknown-openbsd${UNAME_RELEASE}
234 exit 0 ;;
200 exit ;;
235201 *:OpenBSD:*:*)
236 echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
237 exit 0 ;;
202 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
203 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
204 exit ;;
238205 *:ekkoBSD:*:*)
239206 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
240 exit 0 ;;
207 exit ;;
241208 macppc:MirBSD:*:*)
242209 echo powerppc-unknown-mirbsd${UNAME_RELEASE}
243 exit 0 ;;
210 exit ;;
244211 *:MirBSD:*:*)
245212 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
246 exit 0 ;;
213 exit ;;
247214 alpha:OSF1:*:*)
248215 case $UNAME_RELEASE in
249216 *4.0)
296263 # A Xn.n version is an unreleased experimental baselevel.
297264 # 1.2 uses "1.2" for uname -r.
298265 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
299 exit 0 ;;
266 exit ;;
300267 Alpha\ *:Windows_NT*:*)
301268 # How do we know it's Interix rather than the generic POSIX subsystem?
302269 # Should we change UNAME_MACHINE based on the output of uname instead
303270 # of the specific Alpha model?
304271 echo alpha-pc-interix
305 exit 0 ;;
272 exit ;;
306273 21064:Windows_NT:50:3)
307274 echo alpha-dec-winnt3.5
308 exit 0 ;;
275 exit ;;
309276 Amiga*:UNIX_System_V:4.0:*)
310277 echo m68k-unknown-sysv4
311 exit 0;;
278 exit ;;
312279 *:[Aa]miga[Oo][Ss]:*:*)
313280 echo ${UNAME_MACHINE}-unknown-amigaos
314 exit 0 ;;
281 exit ;;
315282 *:[Mm]orph[Oo][Ss]:*:*)
316283 echo ${UNAME_MACHINE}-unknown-morphos
317 exit 0 ;;
284 exit ;;
318285 *:OS/390:*:*)
319286 echo i370-ibm-openedition
320 exit 0 ;;
287 exit ;;
321288 *:z/VM:*:*)
322289 echo s390-ibm-zvmoe
323 exit 0 ;;
290 exit ;;
324291 *:OS400:*:*)
325292 echo powerpc-ibm-os400
326 exit 0 ;;
293 exit ;;
327294 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
328295 echo arm-acorn-riscix${UNAME_RELEASE}
329 exit 0;;
296 exit ;;
297 arm:riscos:*:*|arm:RISCOS:*:*)
298 echo arm-unknown-riscos
299 exit ;;
330300 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
331301 echo hppa1.1-hitachi-hiuxmpp
332 exit 0;;
302 exit ;;
333303 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
334304 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
335305 if test "`(/bin/universe) 2>/dev/null`" = att ; then
337307 else
338308 echo pyramid-pyramid-bsd
339309 fi
340 exit 0 ;;
310 exit ;;
341311 NILE*:*:*:dcosx)
342312 echo pyramid-pyramid-svr4
343 exit 0 ;;
313 exit ;;
344314 DRS?6000:unix:4.0:6*)
345315 echo sparc-icl-nx6
346 exit 0 ;;
316 exit ;;
347317 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
348318 case `/usr/bin/uname -p` in
349 sparc) echo sparc-icl-nx7 && exit 0 ;;
319 sparc) echo sparc-icl-nx7; exit ;;
350320 esac ;;
351321 sun4H:SunOS:5.*:*)
352322 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353 exit 0 ;;
323 exit ;;
354324 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355325 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356 exit 0 ;;
326 exit ;;
357327 i86pc:SunOS:5.*:*)
358328 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
359 exit 0 ;;
329 exit ;;
360330 sun4*:SunOS:6*:*)
361331 # According to config.sub, this is the proper way to canonicalize
362332 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
363333 # it's likely to be more like Solaris than SunOS4.
364334 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
365 exit 0 ;;
335 exit ;;
366336 sun4*:SunOS:*:*)
367337 case "`/usr/bin/arch -k`" in
368338 Series*|S4*)
371341 esac
372342 # Japanese Language versions have a version number like `4.1.3-JL'.
373343 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
374 exit 0 ;;
344 exit ;;
375345 sun3*:SunOS:*:*)
376346 echo m68k-sun-sunos${UNAME_RELEASE}
377 exit 0 ;;
347 exit ;;
378348 sun*:*:4.2BSD:*)
379349 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
380350 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
386356 echo sparc-sun-sunos${UNAME_RELEASE}
387357 ;;
388358 esac
389 exit 0 ;;
359 exit ;;
390360 aushp:SunOS:*:*)
391361 echo sparc-auspex-sunos${UNAME_RELEASE}
392 exit 0 ;;
362 exit ;;
393363 # The situation for MiNT is a little confusing. The machine name
394364 # can be virtually everything (everything which is not
395365 # "atarist" or "atariste" at least should have a processor
400370 # be no problem.
401371 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
402372 echo m68k-atari-mint${UNAME_RELEASE}
403 exit 0 ;;
373 exit ;;
404374 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
405375 echo m68k-atari-mint${UNAME_RELEASE}
406 exit 0 ;;
376 exit ;;
407377 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
408378 echo m68k-atari-mint${UNAME_RELEASE}
409 exit 0 ;;
379 exit ;;
410380 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
411381 echo m68k-milan-mint${UNAME_RELEASE}
412 exit 0 ;;
382 exit ;;
413383 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
414384 echo m68k-hades-mint${UNAME_RELEASE}
415 exit 0 ;;
385 exit ;;
416386 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
417387 echo m68k-unknown-mint${UNAME_RELEASE}
418 exit 0 ;;
388 exit ;;
419389 m68k:machten:*:*)
420390 echo m68k-apple-machten${UNAME_RELEASE}
421 exit 0 ;;
391 exit ;;
422392 powerpc:machten:*:*)
423393 echo powerpc-apple-machten${UNAME_RELEASE}
424 exit 0 ;;
394 exit ;;
425395 RISC*:Mach:*:*)
426396 echo mips-dec-mach_bsd4.3
427 exit 0 ;;
397 exit ;;
428398 RISC*:ULTRIX:*:*)
429399 echo mips-dec-ultrix${UNAME_RELEASE}
430 exit 0 ;;
400 exit ;;
431401 VAX*:ULTRIX*:*:*)
432402 echo vax-dec-ultrix${UNAME_RELEASE}
433 exit 0 ;;
403 exit ;;
434404 2020:CLIX:*:* | 2430:CLIX:*:*)
435405 echo clipper-intergraph-clix${UNAME_RELEASE}
436 exit 0 ;;
406 exit ;;
437407 mips:*:*:UMIPS | mips:*:*:RISCos)
438408 eval $set_cc_for_build
439409 sed 's/^ //' << EOF >$dummy.c
457427 exit (-1);
458428 }
459429 EOF
460 $CC_FOR_BUILD -o $dummy $dummy.c \
461 && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
462 && exit 0
430 $CC_FOR_BUILD -o $dummy $dummy.c &&
431 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
432 SYSTEM_NAME=`$dummy $dummyarg` &&
433 { echo "$SYSTEM_NAME"; exit; }
463434 echo mips-mips-riscos${UNAME_RELEASE}
464 exit 0 ;;
435 exit ;;
465436 Motorola:PowerMAX_OS:*:*)
466437 echo powerpc-motorola-powermax
467 exit 0 ;;
438 exit ;;
468439 Motorola:*:4.3:PL8-*)
469440 echo powerpc-harris-powermax
470 exit 0 ;;
441 exit ;;
471442 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
472443 echo powerpc-harris-powermax
473 exit 0 ;;
444 exit ;;
474445 Night_Hawk:Power_UNIX:*:*)
475446 echo powerpc-harris-powerunix
476 exit 0 ;;
447 exit ;;
477448 m88k:CX/UX:7*:*)
478449 echo m88k-harris-cxux7
479 exit 0 ;;
450 exit ;;
480451 m88k:*:4*:R4*)
481452 echo m88k-motorola-sysv4
482 exit 0 ;;
453 exit ;;
483454 m88k:*:3*:R3*)
484455 echo m88k-motorola-sysv3
485 exit 0 ;;
456 exit ;;
486457 AViiON:dgux:*:*)
487458 # DG/UX returns AViiON for all architectures
488459 UNAME_PROCESSOR=`/usr/bin/uname -p`
498469 else
499470 echo i586-dg-dgux${UNAME_RELEASE}
500471 fi
501 exit 0 ;;
472 exit ;;
502473 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
503474 echo m88k-dolphin-sysv3
504 exit 0 ;;
475 exit ;;
505476 M88*:*:R3*:*)
506477 # Delta 88k system running SVR3
507478 echo m88k-motorola-sysv3
508 exit 0 ;;
479 exit ;;
509480 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
510481 echo m88k-tektronix-sysv3
511 exit 0 ;;
482 exit ;;
512483 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
513484 echo m68k-tektronix-bsd
514 exit 0 ;;
485 exit ;;
515486 *:IRIX*:*:*)
516487 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
517 exit 0 ;;
488 exit ;;
518489 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
519 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
520 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
490 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
491 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
521492 i*86:AIX:*:*)
522493 echo i386-ibm-aix
523 exit 0 ;;
494 exit ;;
524495 ia64:AIX:*:*)
525496 if [ -x /usr/bin/oslevel ] ; then
526497 IBM_REV=`/usr/bin/oslevel`
528499 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
529500 fi
530501 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
531 exit 0 ;;
502 exit ;;
532503 *:AIX:2:3)
533504 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
534505 eval $set_cc_for_build
543514 exit(0);
544515 }
545516 EOF
546 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
547 echo rs6000-ibm-aix3.2.5
517 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
518 then
519 echo "$SYSTEM_NAME"
520 else
521 echo rs6000-ibm-aix3.2.5
522 fi
548523 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
549524 echo rs6000-ibm-aix3.2.4
550525 else
551526 echo rs6000-ibm-aix3.2
552527 fi
553 exit 0 ;;
528 exit ;;
554529 *:AIX:*:[45])
555530 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
556531 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
564539 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
565540 fi
566541 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
567 exit 0 ;;
542 exit ;;
568543 *:AIX:*:*)
569544 echo rs6000-ibm-aix
570 exit 0 ;;
545 exit ;;
571546 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
572547 echo romp-ibm-bsd4.4
573 exit 0 ;;
548 exit ;;
574549 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
575550 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
576 exit 0 ;; # report: romp-ibm BSD 4.3
551 exit ;; # report: romp-ibm BSD 4.3
577552 *:BOSX:*:*)
578553 echo rs6000-bull-bosx
579 exit 0 ;;
554 exit ;;
580555 DPX/2?00:B.O.S.:*:*)
581556 echo m68k-bull-sysv3
582 exit 0 ;;
557 exit ;;
583558 9000/[34]??:4.3bsd:1.*:*)
584559 echo m68k-hp-bsd
585 exit 0 ;;
560 exit ;;
586561 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
587562 echo m68k-hp-bsd4.4
588 exit 0 ;;
563 exit ;;
589564 9000/[34678]??:HP-UX:*:*)
590565 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
591566 case "${UNAME_MACHINE}" in
647622 esac
648623 if [ ${HP_ARCH} = "hppa2.0w" ]
649624 then
650 # avoid double evaluation of $set_cc_for_build
651 test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
652 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
625 eval $set_cc_for_build
626
627 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
628 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
629 # generating 64-bit code. GNU and HP use different nomenclature:
630 #
631 # $ CC_FOR_BUILD=cc ./config.guess
632 # => hppa2.0w-hp-hpux11.23
633 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
634 # => hppa64-hp-hpux11.23
635
636 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
637 grep __LP64__ >/dev/null
653638 then
654639 HP_ARCH="hppa2.0w"
655640 else
657642 fi
658643 fi
659644 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
660 exit 0 ;;
645 exit ;;
661646 ia64:HP-UX:*:*)
662647 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
663648 echo ia64-hp-hpux${HPUX_REV}
664 exit 0 ;;
649 exit ;;
665650 3050*:HI-UX:*:*)
666651 eval $set_cc_for_build
667652 sed 's/^ //' << EOF >$dummy.c
689674 exit (0);
690675 }
691676 EOF
692 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
677 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
678 { echo "$SYSTEM_NAME"; exit; }
693679 echo unknown-hitachi-hiuxwe2
694 exit 0 ;;
680 exit ;;
695681 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
696682 echo hppa1.1-hp-bsd
697 exit 0 ;;
683 exit ;;
698684 9000/8??:4.3bsd:*:*)
699685 echo hppa1.0-hp-bsd
700 exit 0 ;;
686 exit ;;
701687 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
702688 echo hppa1.0-hp-mpeix
703 exit 0 ;;
689 exit ;;
704690 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
705691 echo hppa1.1-hp-osf
706 exit 0 ;;
692 exit ;;
707693 hp8??:OSF1:*:*)
708694 echo hppa1.0-hp-osf
709 exit 0 ;;
695 exit ;;
710696 i*86:OSF1:*:*)
711697 if [ -x /usr/sbin/sysversion ] ; then
712698 echo ${UNAME_MACHINE}-unknown-osf1mk
713699 else
714700 echo ${UNAME_MACHINE}-unknown-osf1
715701 fi
716 exit 0 ;;
702 exit ;;
717703 parisc*:Lites*:*:*)
718704 echo hppa1.1-hp-lites
719 exit 0 ;;
705 exit ;;
720706 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
721707 echo c1-convex-bsd
722 exit 0 ;;
708 exit ;;
723709 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
724710 if getsysinfo -f scalar_acc
725711 then echo c32-convex-bsd
726712 else echo c2-convex-bsd
727713 fi
728 exit 0 ;;
714 exit ;;
729715 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
730716 echo c34-convex-bsd
731 exit 0 ;;
717 exit ;;
732718 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
733719 echo c38-convex-bsd
734 exit 0 ;;
720 exit ;;
735721 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
736722 echo c4-convex-bsd
737 exit 0 ;;
723 exit ;;
738724 CRAY*Y-MP:*:*:*)
739725 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
740 exit 0 ;;
726 exit ;;
741727 CRAY*[A-Z]90:*:*:*)
742728 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
743729 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
744730 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
745731 -e 's/\.[^.]*$/.X/'
746 exit 0 ;;
732 exit ;;
747733 CRAY*TS:*:*:*)
748734 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
749 exit 0 ;;
735 exit ;;
750736 CRAY*T3E:*:*:*)
751737 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752 exit 0 ;;
738 exit ;;
753739 CRAY*SV1:*:*:*)
754740 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
755 exit 0 ;;
741 exit ;;
756742 *:UNICOS/mp:*:*)
757743 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
758 exit 0 ;;
744 exit ;;
759745 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
760746 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
761747 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
762748 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
763749 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
764 exit 0 ;;
750 exit ;;
765751 5000:UNIX_System_V:4.*:*)
766752 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
767753 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
768754 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
769 exit 0 ;;
755 exit ;;
770756 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
771757 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
772 exit 0 ;;
758 exit ;;
773759 sparc*:BSD/OS:*:*)
774760 echo sparc-unknown-bsdi${UNAME_RELEASE}
775 exit 0 ;;
761 exit ;;
776762 *:BSD/OS:*:*)
777763 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
778 exit 0 ;;
764 exit ;;
779765 *:FreeBSD:*:*)
780766 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
781 exit 0 ;;
767 exit ;;
782768 i*:CYGWIN*:*)
783769 echo ${UNAME_MACHINE}-pc-cygwin
784 exit 0 ;;
770 exit ;;
785771 i*:MINGW*:*)
786772 echo ${UNAME_MACHINE}-pc-mingw32
787 exit 0 ;;
773 exit ;;
774 i*:windows32*:*)
775 # uname -m includes "-pc" on this system.
776 echo ${UNAME_MACHINE}-mingw32
777 exit ;;
788778 i*:PW*:*)
789779 echo ${UNAME_MACHINE}-pc-pw32
790 exit 0 ;;
780 exit ;;
791781 x86:Interix*:[34]*)
792782 echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
793 exit 0 ;;
783 exit ;;
794784 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
795785 echo i${UNAME_MACHINE}-pc-mks
796 exit 0 ;;
786 exit ;;
797787 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
798788 # How do we know it's Interix rather than the generic POSIX subsystem?
799789 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
800790 # UNAME_MACHINE based on the output of uname instead of i386?
801791 echo i586-pc-interix
802 exit 0 ;;
792 exit ;;
803793 i*:UWIN*:*)
804794 echo ${UNAME_MACHINE}-pc-uwin
805 exit 0 ;;
806 amd64:CYGWIN*:*:*)
795 exit ;;
796 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
807797 echo x86_64-unknown-cygwin
808 exit 0 ;;
798 exit ;;
809799 p*:CYGWIN*:*)
810800 echo powerpcle-unknown-cygwin
811 exit 0 ;;
801 exit ;;
812802 prep*:SunOS:5.*:*)
813803 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
814 exit 0 ;;
804 exit ;;
815805 *:GNU:*:*)
816806 # the GNU system
817807 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
818 exit 0 ;;
808 exit ;;
819809 *:GNU/*:*:*)
820810 # other systems with GNU libc and userland
821811 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
822 exit 0 ;;
812 exit ;;
823813 i*86:Minix:*:*)
824814 echo ${UNAME_MACHINE}-pc-minix
825 exit 0 ;;
815 exit ;;
826816 arm*:Linux:*:*)
827817 echo ${UNAME_MACHINE}-unknown-linux-gnu
828 exit 0 ;;
818 exit ;;
829819 cris:Linux:*:*)
830820 echo cris-axis-linux-gnu
831 exit 0 ;;
821 exit ;;
832822 crisv32:Linux:*:*)
833823 echo crisv32-axis-linux-gnu
834 exit 0 ;;
824 exit ;;
835825 frv:Linux:*:*)
836826 echo frv-unknown-linux-gnu
837 exit 0 ;;
827 exit ;;
838828 ia64:Linux:*:*)
839829 echo ${UNAME_MACHINE}-unknown-linux-gnu
840 exit 0 ;;
830 exit ;;
841831 m32r*:Linux:*:*)
842832 echo ${UNAME_MACHINE}-unknown-linux-gnu
843 exit 0 ;;
833 exit ;;
844834 m68*:Linux:*:*)
845835 echo ${UNAME_MACHINE}-unknown-linux-gnu
846 exit 0 ;;
836 exit ;;
847837 mips:Linux:*:*)
848838 eval $set_cc_for_build
849839 sed 's/^ //' << EOF >$dummy.c
861851 #endif
862852 EOF
863853 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
864 test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
854 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
865855 ;;
866856 mips64:Linux:*:*)
867857 eval $set_cc_for_build
880870 #endif
881871 EOF
882872 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
883 test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
873 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
884874 ;;
875 or32:Linux:*:*)
876 echo or32-unknown-linux-gnu
877 exit ;;
885878 ppc:Linux:*:*)
886879 echo powerpc-unknown-linux-gnu
887 exit 0 ;;
880 exit ;;
888881 ppc64:Linux:*:*)
889882 echo powerpc64-unknown-linux-gnu
890 exit 0 ;;
883 exit ;;
891884 alpha:Linux:*:*)
892885 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
893886 EV5) UNAME_MACHINE=alphaev5 ;;
901894 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
902895 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
903896 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
904 exit 0 ;;
897 exit ;;
905898 parisc:Linux:*:* | hppa:Linux:*:*)
906899 # Look for CPU level
907900 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
909902 PA8*) echo hppa2.0-unknown-linux-gnu ;;
910903 *) echo hppa-unknown-linux-gnu ;;
911904 esac
912 exit 0 ;;
905 exit ;;
913906 parisc64:Linux:*:* | hppa64:Linux:*:*)
914907 echo hppa64-unknown-linux-gnu
915 exit 0 ;;
908 exit ;;
916909 s390:Linux:*:* | s390x:Linux:*:*)
917910 echo ${UNAME_MACHINE}-ibm-linux
918 exit 0 ;;
911 exit ;;
919912 sh64*:Linux:*:*)
920913 echo ${UNAME_MACHINE}-unknown-linux-gnu
921 exit 0 ;;
914 exit ;;
922915 sh*:Linux:*:*)
923916 echo ${UNAME_MACHINE}-unknown-linux-gnu
924 exit 0 ;;
917 exit ;;
925918 sparc:Linux:*:* | sparc64:Linux:*:*)
926919 echo ${UNAME_MACHINE}-unknown-linux-gnu
927 exit 0 ;;
920 exit ;;
928921 x86_64:Linux:*:*)
929922 echo x86_64-unknown-linux-gnu
930 exit 0 ;;
923 exit ;;
931924 i*86:Linux:*:*)
932925 # The BFD linker knows what the default object file format is, so
933926 # first see if it will tell us. cd to the root directory to prevent
945938 ;;
946939 a.out-i386-linux)
947940 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
948 exit 0 ;;
941 exit ;;
949942 coff-i386)
950943 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
951 exit 0 ;;
944 exit ;;
952945 "")
953946 # Either a pre-BFD a.out linker (linux-gnuoldld) or
954947 # one that does not give us useful --help.
955948 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
956 exit 0 ;;
949 exit ;;
957950 esac
958951 # Determine whether the default compiler is a.out or elf
959952 eval $set_cc_for_build
981974 #endif
982975 EOF
983976 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
984 test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
985 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
977 test x"${LIBC}" != x && {
978 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
979 exit
980 }
981 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
986982 ;;
987983 i*86:DYNIX/ptx:4*:*)
988984 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
989985 # earlier versions are messed up and put the nodename in both
990986 # sysname and nodename.
991987 echo i386-sequent-sysv4
992 exit 0 ;;
988 exit ;;
993989 i*86:UNIX_SV:4.2MP:2.*)
994990 # Unixware is an offshoot of SVR4, but it has its own version
995991 # number series starting with 2...
997993 # I just have to hope. -- rms.
998994 # Use sysv4.2uw... so that sysv4* matches it.
999995 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1000 exit 0 ;;
996 exit ;;
1001997 i*86:OS/2:*:*)
1002998 # If we were able to find `uname', then EMX Unix compatibility
1003999 # is probably installed.
10041000 echo ${UNAME_MACHINE}-pc-os2-emx
1005 exit 0 ;;
1001 exit ;;
10061002 i*86:XTS-300:*:STOP)
10071003 echo ${UNAME_MACHINE}-unknown-stop
1008 exit 0 ;;
1004 exit ;;
10091005 i*86:atheos:*:*)
10101006 echo ${UNAME_MACHINE}-unknown-atheos
1011 exit 0 ;;
1012 i*86:syllable:*:*)
1007 exit ;;
1008 i*86:syllable:*:*)
10131009 echo ${UNAME_MACHINE}-pc-syllable
1014 exit 0 ;;
1010 exit ;;
10151011 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10161012 echo i386-unknown-lynxos${UNAME_RELEASE}
1017 exit 0 ;;
1013 exit ;;
10181014 i*86:*DOS:*:*)
10191015 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1020 exit 0 ;;
1016 exit ;;
10211017 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10221018 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10231019 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10251021 else
10261022 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10271023 fi
1028 exit 0 ;;
1029 i*86:*:5:[78]*)
1024 exit ;;
1025 i*86:*:5:[678]*)
1026 # UnixWare 7.x, OpenUNIX and OpenServer 6.
10301027 case `/bin/uname -X | grep "^Machine"` in
10311028 *486*) UNAME_MACHINE=i486 ;;
10321029 *Pentium) UNAME_MACHINE=i586 ;;
10331030 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10341031 esac
10351032 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1036 exit 0 ;;
1033 exit ;;
10371034 i*86:*:3.2:*)
10381035 if test -f /usr/options/cb.name; then
10391036 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10511048 else
10521049 echo ${UNAME_MACHINE}-pc-sysv32
10531050 fi
1054 exit 0 ;;
1051 exit ;;
10551052 pc:*:*:*)
10561053 # Left here for compatibility:
10571054 # uname -m prints for DJGPP always 'pc', but it prints nothing about
10581055 # the processor, so we play safe by assuming i386.
10591056 echo i386-pc-msdosdjgpp
1060 exit 0 ;;
1057 exit ;;
10611058 Intel:Mach:3*:*)
10621059 echo i386-pc-mach3
1063 exit 0 ;;
1060 exit ;;
10641061 paragon:*:*:*)
10651062 echo i860-intel-osf1
1066 exit 0 ;;
1063 exit ;;
10671064 i860:*:4.*:*) # i860-SVR4
10681065 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
10691066 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
10701067 else # Add other i860-SVR4 vendors below as they are discovered.
10711068 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
10721069 fi
1073 exit 0 ;;
1070 exit ;;
10741071 mini*:CTIX:SYS*5:*)
10751072 # "miniframe"
10761073 echo m68010-convergent-sysv
1077 exit 0 ;;
1074 exit ;;
10781075 mc68k:UNIX:SYSTEM5:3.51m)
10791076 echo m68k-convergent-sysv
1080 exit 0 ;;
1077 exit ;;
10811078 M680?0:D-NIX:5.3:*)
10821079 echo m68k-diab-dnix
1083 exit 0 ;;
1080 exit ;;
10841081 M68*:*:R3V[5678]*:*)
1085 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1082 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
10861083 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)
10871084 OS_REL=''
10881085 test -r /etc/.relid \
10891086 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
10901087 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1091 && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1088 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
10921089 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1093 && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1090 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
10941091 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
10951092 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1096 && echo i486-ncr-sysv4 && exit 0 ;;
1093 && { echo i486-ncr-sysv4; exit; } ;;
10971094 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
10981095 echo m68k-unknown-lynxos${UNAME_RELEASE}
1099 exit 0 ;;
1096 exit ;;
11001097 mc68030:UNIX_System_V:4.*:*)
11011098 echo m68k-atari-sysv4
1102 exit 0 ;;
1099 exit ;;
11031100 TSUNAMI:LynxOS:2.*:*)
11041101 echo sparc-unknown-lynxos${UNAME_RELEASE}
1105 exit 0 ;;
1102 exit ;;
11061103 rs6000:LynxOS:2.*:*)
11071104 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1108 exit 0 ;;
1105 exit ;;
11091106 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11101107 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1111 exit 0 ;;
1108 exit ;;
11121109 SM[BE]S:UNIX_SV:*:*)
11131110 echo mips-dde-sysv${UNAME_RELEASE}
1114 exit 0 ;;
1111 exit ;;
11151112 RM*:ReliantUNIX-*:*:*)
11161113 echo mips-sni-sysv4
1117 exit 0 ;;
1114 exit ;;
11181115 RM*:SINIX-*:*:*)
11191116 echo mips-sni-sysv4
1120 exit 0 ;;
1117 exit ;;
11211118 *:SINIX-*:*:*)
11221119 if uname -p 2>/dev/null >/dev/null ; then
11231120 UNAME_MACHINE=`(uname -p) 2>/dev/null`
11251122 else
11261123 echo ns32k-sni-sysv
11271124 fi
1128 exit 0 ;;
1125 exit ;;
11291126 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11301127 # says <Richard.M.Bartel@ccMail.Census.GOV>
11311128 echo i586-unisys-sysv4
1132 exit 0 ;;
1129 exit ;;
11331130 *:UNIX_System_V:4*:FTX*)
11341131 # From Gerald Hewes <hewes@openmarket.com>.
11351132 # How about differentiating between stratus architectures? -djm
11361133 echo hppa1.1-stratus-sysv4
1137 exit 0 ;;
1134 exit ;;
11381135 *:*:*:FTX*)
11391136 # From seanf@swdc.stratus.com.
11401137 echo i860-stratus-sysv4
1141 exit 0 ;;
1138 exit ;;
11421139 i*86:VOS:*:*)
11431140 # From Paul.Green@stratus.com.
11441141 echo ${UNAME_MACHINE}-stratus-vos
1145 exit 0 ;;
1142 exit ;;
11461143 *:VOS:*:*)
11471144 # From Paul.Green@stratus.com.
11481145 echo hppa1.1-stratus-vos
1149 exit 0 ;;
1146 exit ;;
11501147 mc68*:A/UX:*:*)
11511148 echo m68k-apple-aux${UNAME_RELEASE}
1152 exit 0 ;;
1149 exit ;;
11531150 news*:NEWS-OS:6*:*)
11541151 echo mips-sony-newsos6
1155 exit 0 ;;
1152 exit ;;
11561153 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
11571154 if [ -d /usr/nec ]; then
11581155 echo mips-nec-sysv${UNAME_RELEASE}
11591156 else
11601157 echo mips-unknown-sysv${UNAME_RELEASE}
11611158 fi
1162 exit 0 ;;
1159 exit ;;
11631160 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
11641161 echo powerpc-be-beos
1165 exit 0 ;;
1162 exit ;;
11661163 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
11671164 echo powerpc-apple-beos
1168 exit 0 ;;
1165 exit ;;
11691166 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
11701167 echo i586-pc-beos
1171 exit 0 ;;
1168 exit ;;
11721169 SX-4:SUPER-UX:*:*)
11731170 echo sx4-nec-superux${UNAME_RELEASE}
1174 exit 0 ;;
1171 exit ;;
11751172 SX-5:SUPER-UX:*:*)
11761173 echo sx5-nec-superux${UNAME_RELEASE}
1177 exit 0 ;;
1174 exit ;;
11781175 SX-6:SUPER-UX:*:*)
11791176 echo sx6-nec-superux${UNAME_RELEASE}
1180 exit 0 ;;
1177 exit ;;
11811178 Power*:Rhapsody:*:*)
11821179 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1183 exit 0 ;;
1180 exit ;;
11841181 *:Rhapsody:*:*)
11851182 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1186 exit 0 ;;
1183 exit ;;
11871184 *:Darwin:*:*)
11881185 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
11891186 case $UNAME_PROCESSOR in
11911188 unknown) UNAME_PROCESSOR=powerpc ;;
11921189 esac
11931190 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1194 exit 0 ;;
1191 exit ;;
11951192 *:procnto*:*:* | *:QNX:[0123456789]*:*)
11961193 UNAME_PROCESSOR=`uname -p`
11971194 if test "$UNAME_PROCESSOR" = "x86"; then
11991196 UNAME_MACHINE=pc
12001197 fi
12011198 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1202 exit 0 ;;
1199 exit ;;
12031200 *:QNX:*:4*)
12041201 echo i386-pc-qnx
1205 exit 0 ;;
1202 exit ;;
12061203 NSE-?:NONSTOP_KERNEL:*:*)
12071204 echo nse-tandem-nsk${UNAME_RELEASE}
1208 exit 0 ;;
1205 exit ;;
12091206 NSR-?:NONSTOP_KERNEL:*:*)
12101207 echo nsr-tandem-nsk${UNAME_RELEASE}
1211 exit 0 ;;
1208 exit ;;
12121209 *:NonStop-UX:*:*)
12131210 echo mips-compaq-nonstopux
1214 exit 0 ;;
1211 exit ;;
12151212 BS2000:POSIX*:*:*)
12161213 echo bs2000-siemens-sysv
1217 exit 0 ;;
1214 exit ;;
12181215 DS/*:UNIX_System_V:*:*)
12191216 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1220 exit 0 ;;
1217 exit ;;
12211218 *:Plan9:*:*)
12221219 # "uname -m" is not consistent, so use $cputype instead. 386
12231220 # is converted to i386 for consistency with other x86
12281225 UNAME_MACHINE="$cputype"
12291226 fi
12301227 echo ${UNAME_MACHINE}-unknown-plan9
1231 exit 0 ;;
1228 exit ;;
12321229 *:TOPS-10:*:*)
12331230 echo pdp10-unknown-tops10
1234 exit 0 ;;
1231 exit ;;
12351232 *:TENEX:*:*)
12361233 echo pdp10-unknown-tenex
1237 exit 0 ;;
1234 exit ;;
12381235 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
12391236 echo pdp10-dec-tops20
1240 exit 0 ;;
1237 exit ;;
12411238 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
12421239 echo pdp10-xkl-tops20
1243 exit 0 ;;
1240 exit ;;
12441241 *:TOPS-20:*:*)
12451242 echo pdp10-unknown-tops20
1246 exit 0 ;;
1243 exit ;;
12471244 *:ITS:*:*)
12481245 echo pdp10-unknown-its
1249 exit 0 ;;
1246 exit ;;
12501247 SEI:*:*:SEIUX)
12511248 echo mips-sei-seiux${UNAME_RELEASE}
1252 exit 0 ;;
1249 exit ;;
12531250 *:DragonFly:*:*)
12541251 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1255 exit 0 ;;
1252 exit ;;
12561253 *:*VMS:*:*)
12571254 UNAME_MACHINE=`(uname -p) 2>/dev/null`
12581255 case "${UNAME_MACHINE}" in
1259 A*) echo alpha-dec-vms && exit 0 ;;
1260 I*) echo ia64-dec-vms && exit 0 ;;
1261 V*) echo vax-dec-vms && exit 0 ;;
1256 A*) echo alpha-dec-vms ; exit ;;
1257 I*) echo ia64-dec-vms ; exit ;;
1258 V*) echo vax-dec-vms ; exit ;;
12621259 esac ;;
12631260 *:XENIX:*:SysV)
12641261 echo i386-pc-xenix
1265 exit 0 ;;
1262 exit ;;
1263 i*86:skyos:*:*)
1264 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1265 exit ;;
12661266 esac
12671267
12681268 #echo '(No uname command or uname output not recognized.)' 1>&2
12941294 #endif
12951295
12961296 #if defined (__arm) && defined (__acorn) && defined (__unix)
1297 printf ("arm-acorn-riscix"); exit (0);
1297 printf ("arm-acorn-riscix\n"); exit (0);
12981298 #endif
12991299
13001300 #if defined (hp300) && !defined (hpux)
13831383 }
13841384 EOF
13851385
1386 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1386 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1387 { echo "$SYSTEM_NAME"; exit; }
13871388
13881389 # Apollos put the system type in the environment.
13891390
1390 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1391 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
13911392
13921393 # Convex versions that predate uname can use getsysinfo(1)
13931394
13961397 case `getsysinfo -f cpu_type` in
13971398 c1*)
13981399 echo c1-convex-bsd
1399 exit 0 ;;
1400 exit ;;
14001401 c2*)
14011402 if getsysinfo -f scalar_acc
14021403 then echo c32-convex-bsd
14031404 else echo c2-convex-bsd
14041405 fi
1405 exit 0 ;;
1406 exit ;;
14061407 c34*)
14071408 echo c34-convex-bsd
1408 exit 0 ;;
1409 exit ;;
14091410 c38*)
14101411 echo c38-convex-bsd
1411 exit 0 ;;
1412 exit ;;
14121413 c4*)
14131414 echo c4-convex-bsd
1414 exit 0 ;;
1415 exit ;;
14151416 esac
14161417 fi
14171418
22 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
33 # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
44
5 timestamp='2005-04-22'
5 timestamp='2005-07-08'
66
77 # This file is (in principle) common to ALL GNU software.
88 # The presence of a machine in this file suggests that SOME GNU software
2020 #
2121 # You should have received a copy of the GNU General Public License
2222 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330,
24 # Boston, MA 02111-1307, USA.
25
23 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
24 # 02110-1301, USA.
25 #
2626 # As a special exception to the GNU General Public License, if you
2727 # distribute this file as part of a program that contains a
2828 # configuration script generated by Autoconf, you may include it under
2929 # the same distribution terms that you use for the rest of that program.
30
3031
3132 # Please send patches to <config-patches@gnu.org>. Submit a context
3233 # diff and a properly formatted ChangeLog entry.
8283 while test $# -gt 0 ; do
8384 case $1 in
8485 --time-stamp | --time* | -t )
85 echo "$timestamp" ; exit 0 ;;
86 echo "$timestamp" ; exit ;;
8687 --version | -v )
87 echo "$version" ; exit 0 ;;
88 echo "$version" ; exit ;;
8889 --help | --h* | -h )
89 echo "$usage"; exit 0 ;;
90 echo "$usage"; exit ;;
9091 -- ) # Stop option processing
9192 shift; break ;;
9293 - ) # Use stdin as input.
9899 *local*)
99100 # First pass through any local machine types.
100101 echo $1
101 exit 0;;
102 exit ;;
102103
103104 * )
104105 break ;;
246247 | mips64vr4100 | mips64vr4100el \
247248 | mips64vr4300 | mips64vr4300el \
248249 | mips64vr5000 | mips64vr5000el \
250 | mips64vr5900 | mips64vr5900el \
249251 | mipsisa32 | mipsisa32el \
250252 | mipsisa32r2 | mipsisa32r2el \
251253 | mipsisa64 | mipsisa64el \
254256 | mipsisa64sr71k | mipsisa64sr71kel \
255257 | mipstx39 | mipstx39el \
256258 | mn10200 | mn10300 \
259 | ms1 \
257260 | msp430 \
258261 | ns16k | ns32k \
259 | openrisc | or32 \
262 | or32 \
260263 | pdp10 | pdp11 | pj | pjl \
261264 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
262265 | pyramid \
263 | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
266 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
264267 | sh64 | sh64le \
265268 | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
266269 | sparcv8 | sparcv9 | sparcv9b \
270273 | we32k \
271274 | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
272275 | z8k)
276 basic_machine=$basic_machine-unknown
277 ;;
278 m32c)
273279 basic_machine=$basic_machine-unknown
274280 ;;
275281 m6811 | m68hc11 | m6812 | m68hc12)
320326 | mips64vr4100-* | mips64vr4100el-* \
321327 | mips64vr4300-* | mips64vr4300el-* \
322328 | mips64vr5000-* | mips64vr5000el-* \
329 | mips64vr5900-* | mips64vr5900el-* \
323330 | mipsisa32-* | mipsisa32el-* \
324331 | mipsisa32r2-* | mipsisa32r2el-* \
325332 | mipsisa64-* | mipsisa64el-* \
328335 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
329336 | mipstx39-* | mipstx39el-* \
330337 | mmix-* \
338 | ms1-* \
331339 | msp430-* \
332340 | none-* | np1-* | ns16k-* | ns32k-* \
333341 | orion-* \
335343 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
336344 | pyramid-* \
337345 | romp-* | rs6000-* \
338 | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
346 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
339347 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
340348 | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
341349 | sparclite-* \
350358 | ymp-* \
351359 | z8k-*)
352360 ;;
361 m32c-*)
362 ;;
353363 # Recognize the various machine names and aliases which stand
354364 # for a CPU type and a company and sometimes even an OS.
355365 386bsd)
760770 basic_machine=hppa1.1-oki
761771 os=-proelf
762772 ;;
763 or32 | or32-*)
773 openrisc | openrisc-*)
764774 basic_machine=or32-unknown
765 os=-coff
766775 ;;
767776 os400)
768777 basic_machine=powerpc-ibm
10881097 we32k)
10891098 basic_machine=we32k-att
10901099 ;;
1091 sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
1100 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
10921101 basic_machine=sh-unknown
1093 ;;
1094 sh64)
1095 basic_machine=sh64-unknown
10961102 ;;
10971103 sparc | sparcv8 | sparcv9 | sparcv9b)
10981104 basic_machine=sparc-sun
11801186 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
11811187 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
11821188 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1183 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
1189 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1190 | -skyos* | -haiku*)
11841191 # Remember, each alternative MUST END IN *, to match a version number.
11851192 ;;
11861193 -qnx*)
11981205 os=`echo $os | sed -e 's|nto|nto-qnx|'`
11991206 ;;
12001207 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1201 | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
1208 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
12021209 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
12031210 ;;
12041211 -mac*)
13861393 ;;
13871394 *-be)
13881395 os=-beos
1396 ;;
1397 *-haiku)
1398 os=-haiku
13891399 ;;
13901400 *-ibm)
13911401 os=-aix
15581568 esac
15591569
15601570 echo $basic_machine$os
1561 exit 0
1571 exit
15621572
15631573 # Local variables:
15641574 # eval: (add-hook 'write-file-hooks 'time-stamp)
14971497
14981498
14991499 VERSION_MAJOR=0
1500 VERSION_MINOR=38
1501
1502 API_CURRENT=3
1500 VERSION_MINOR=39
1501
1502 API_CURRENT=4
15031503 API_REVISION=0
15041504 API_COMPATIBILITY=3
15051505
00 dnl Process this file with autoconf to create configure
1 dnl $Id: configure.in,v 1.46 2005/07/20 10:20:18 alfie Exp $
1 dnl $Id: configure.in,v 1.47 2005/09/17 08:37:15 hoa Exp $
22
33 AC_INIT(src/main/libetpan_version.h.in)
44
55 dnl Version major and minor
66 VERSION_MAJOR=0
7 VERSION_MINOR=38
7 VERSION_MINOR=39
88
99 dnl API version
1010 dnl 1. If you have changed any of the sources for this library, the revision
2020 dnl interface, then you have broken backward compatibility and age must be
2121 dnl reset to `0'. This release has a new, but backwards incompatible
2222 dnl interface.
23 API_CURRENT=3
23 API_CURRENT=4
2424 API_REVISION=0
2525 API_COMPATIBILITY=3
2626
0 libetpan (0.39.1-1) unstable; urgency=low
1
2 * New upstream release (Closes: #329202).
3 * Increased version in shlibs file, because of API_CURRENT increase.
4 * Bump Standards-Version to 3.6.2, no changes needed.
5
6 -- Nikita V. Youshchenko <yoush@cs.msu.su> Sat, 24 Sep 2005 01:08:20 +0400
7
08 libetpan (0.38-2) unstable; urgency=low
19
210 * Changed dependency from libgnutls11-dev to libgnutls-dev, per announced
22 Priority: optional
33 Maintainer: Nikita V. Youshchenko <yoush@cs.msu.su>
44 Build-Depends: debhelper (>> 4.0.0), dpatch, libdb4.2-dev, libgnutls-dev, liblockfile-dev, libsasl2-dev
5 Standards-Version: 3.6.1
5 Standards-Version: 3.6.2
66
77 Package: libetpan-dev
88 Section: libdevel
6868 dh_strip -a
6969 dh_compress -a
7070 dh_fixperms -a
71 dh_makeshlibs -plibetpan3 -V"libetpan3 (>= 0.38-1)"
71 dh_makeshlibs -plibetpan3 -V"libetpan3 (>= 0.39.1-1)"
7272 dh_installdeb -a
7373 dh_shlibdeps -a
7474 dh_gencontrol -a
2929 */
3030
3131 /*
32 * $Id: mailstream.c,v 1.16 2005/06/01 12:21:57 smarinier Exp $
32 * $Id: mailstream.c,v 1.17 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mailstream.h"
393393 return s->read_buffer_len;
394394 }
395395
396 #ifdef _MSC_VER
396 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
397397 struct timeval mailstream_network_delay =
398398 { DEFAULT_NETWORK_TIMEOUT, 0 };
399399 #else
2929 */
3030
3131 /*
32 * $Id: mailstream_socket.c,v 1.18 2005/06/01 14:34:51 hoa Exp $
32 * $Id: mailstream_socket.c,v 1.19 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mailstream_socket.h"
7070 static int mailstream_low_socket_get_fd(mailstream_low * s);
7171
7272 static mailstream_low_driver local_mailstream_socket_driver = {
73 #ifdef _MSC_VER
73 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
7474 /* SEB */
7575 mailstream_low_socket_read,
7676 mailstream_low_socket_write,
2929 */
3030
3131 /*
32 * $Id: mailstream_ssl.c,v 1.22 2005/07/15 15:26:50 hoa Exp $
32 * $Id: mailstream_ssl.c,v 1.24 2005/09/12 13:57:24 hoa Exp $
3333 */
3434
3535 /*
9999 static void mailstream_low_ssl_free(mailstream_low * s);
100100 static int mailstream_low_ssl_get_fd(mailstream_low * s);
101101
102 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
103 static mailstream_low_driver local_mailstream_ssl_driver = {
104 /* mailstream_read */ mailstream_low_ssl_read,
105 /* mailstream_write */ mailstream_low_ssl_write,
106 /* mailstream_close */ mailstream_low_ssl_close,
107 /* mailstream_free */ mailstream_low_ssl_free,
108 /* mailstream_get_fd */ mailstream_low_ssl_get_fd,
109 #else
102110 static mailstream_low_driver local_mailstream_ssl_driver = {
103111 mailstream_read: mailstream_low_ssl_read,
104112 mailstream_write: mailstream_low_ssl_write,
105113 mailstream_close: mailstream_low_ssl_close,
106114 mailstream_free: mailstream_low_ssl_free,
107115 mailstream_get_fd: mailstream_low_ssl_get_fd,
116 #endif
108117 };
109118
110119 mailstream_low_driver * mailstream_ssl_driver = &local_mailstream_ssl_driver;
143152
144153 if (SSL_set_fd(ssl_conn, fd) == 0)
145154 goto free_ssl_conn;
146
147 #ifndef USE_GNUTLS
148 SSL_set_read_ahead(ssl_conn, 1);
149 #endif
150155
151156 r = SSL_connect(ssl_conn);
152157 if (r <= 0)
262267 int ssl_r;
263268 fd_set fds_read;
264269 struct timeval timeout;
265 #ifdef USE_GNUTLS
266 fd_set fds_excp;
267 #endif
268
269 #ifdef USE_GNUTLS
270 timeout = mailstream_network_delay;
271
272 FD_ZERO(&fds_read);
273 FD_SET(ssl_data->fd, &fds_read);
274 FD_ZERO(&fds_excp);
275 FD_SET(ssl_data->fd, &fds_excp);
276 r = select(ssl_data->fd + 1, &fds_read, NULL, &fds_excp, &timeout);
277 if (r==0) {
278 return -1;
279 }
280 if (FD_ISSET(ssl_data->fd, &fds_excp))
281 return -1;
282 if (!FD_ISSET(ssl_data->fd, &fds_read))
283 return 0;
284 #endif
285270
286271 r = SSL_read(ssl_data->ssl_conn, buf, count);
287272 if (r > 0)
288273 return r;
289274
290 #ifdef USE_GNUTLS
291 if ((errno != EAGAIN) && (errno != EWOULDBLOCK))
292 return r;
293 #else
294275 ssl_r = SSL_get_error(ssl_data->ssl_conn, r);
295276 switch (ssl_r) {
296277 case SSL_ERROR_NONE:
312293 default:
313294 return r;
314295 }
315 #endif
316296 }
317297 }
318298
2929 */
3030
3131 /*
32 * $Id: mmapstring.h,v 1.10 2004/11/21 21:53:31 hoa Exp $
32 * $Id: mmapstring.h,v 1.11 2005/08/22 10:07:28 smarinier Exp $
3333 */
3434
3535 #ifndef __MMAP_STRING_H__
3737 #define __MMAP_STRING_H__
3838
3939 #include <sys/types.h>
40
41 #ifndef LIBETPAN_CONFIG_H
42 # include "libetpan-config.h"
43 #endif
4044
4145 #ifdef __cplusplus
4246 extern "C" {
6670
6771 /* Strings
6872 */
69
73 LIBETPAN_EXPORT
7074 MMAPString * mmap_string_new (const char * init);
7175
76 LIBETPAN_EXPORT
7277 MMAPString * mmap_string_new_len (const char * init,
7378 size_t len);
7479
80 LIBETPAN_EXPORT
7581 MMAPString * mmap_string_sized_new (size_t dfl_size);
7682
83 LIBETPAN_EXPORT
7784 void mmap_string_free (MMAPString * string);
7885
86 LIBETPAN_EXPORT
7987 MMAPString * mmap_string_assign (MMAPString * string,
8088 const char * rval);
8189
90 LIBETPAN_EXPORT
8291 MMAPString * mmap_string_truncate (MMAPString *string,
8392 size_t len);
8493
94 LIBETPAN_EXPORT
8595 MMAPString * mmap_string_set_size (MMAPString * string,
8696 size_t len);
8797
98 LIBETPAN_EXPORT
8899 MMAPString * mmap_string_insert_len (MMAPString * string,
89100 size_t pos,
90101 const char * val,
91102 size_t len);
92103
104 LIBETPAN_EXPORT
93105 MMAPString * mmap_string_append (MMAPString * string,
94106 const char * val);
95107
108 LIBETPAN_EXPORT
96109 MMAPString * mmap_string_append_len (MMAPString * string,
97110 const char * val,
98111 size_t len);
99112
113 LIBETPAN_EXPORT
100114 MMAPString * mmap_string_append_c (MMAPString * string,
101115 char c);
102116
117 LIBETPAN_EXPORT
103118 MMAPString * mmap_string_prepend (MMAPString * string,
104119 const char * val);
105120
121 LIBETPAN_EXPORT
106122 MMAPString * mmap_string_prepend_c (MMAPString * string,
107123 char c);
108124
125 LIBETPAN_EXPORT
109126 MMAPString * mmap_string_prepend_len (MMAPString * string,
110127 const char * val,
111128 size_t len);
112129
130 LIBETPAN_EXPORT
113131 MMAPString * mmap_string_insert (MMAPString * string,
114132 size_t pos,
115133 const char * val);
116134
135 LIBETPAN_EXPORT
117136 MMAPString * mmap_string_insert_c (MMAPString *string,
118137 size_t pos,
119138 char c);
120139
140 LIBETPAN_EXPORT
121141 MMAPString * mmap_string_erase(MMAPString * string,
122142 size_t pos,
123143 size_t len);
2929 */
3030
3131 /*
32 * $Id: data_message_driver.c,v 1.7 2005/06/01 12:21:57 smarinier Exp $
32 * $Id: data_message_driver.c,v 1.8 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "data_message_driver.h"
6161
6262
6363 static mailmessage_driver local_data_message_driver = {
64 #ifdef _MSC_VER
64 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
6565 /* msg_name */ "data",
6666
6767 /* msg_initialize */ mailmessage_generic_initialize,
2929 */
3030
3131 /*
32 * $Id: dbdriver.c,v 1.6 2005/06/01 16:04:41 hoa Exp $
32 * $Id: dbdriver.c,v 1.8 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "dbdriver.h"
8686 const char * uid, mailmessage ** result);
8787
8888 static mailsession_driver local_db_session_driver = {
89 #ifdef _MSC_VER
89 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
9090 /* sess_name */ "db",
9191
9292 /* sess_initialize */ initialize,
129129 /* sess_get_messages_list */ get_messages_list,
130130 /* sess_get_envelopes_list */ get_envelopes_list,
131131 /* sess_remove_message */ NULL,
132 /* sess_login_sasl */ NULL,
132133
133134 #else
134135 .sess_name = "db",
173174
174175 .sess_get_message = get_message,
175176 .sess_get_message_by_uid = get_message_by_uid,
177 .sess_login_sasl = NULL,
176178 #endif
177179 };
178180
2929 */
3030
3131 /*
32 * $Id: dbdriver_message.c,v 1.3 2005/06/01 12:21:57 smarinier Exp $
32 * $Id: dbdriver_message.c,v 1.4 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "dbdriver_message.h"
6262 static void check(mailmessage * msg_info);
6363
6464 static mailmessage_driver local_db_message_driver = {
65 #ifdef _MSC_VER
65 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
6666 /* msg_name */ "db",
6767
6868 /* msg_initialize */ initialize,
2929 */
3030
3131 /*
32 * $Id: dbstorage.c,v 1.3 2005/06/01 12:21:57 smarinier Exp $
32 * $Id: dbstorage.c,v 1.4 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "dbstorage.h"
5252 static void db_mailstorage_uninitialize(struct mailstorage * storage);
5353
5454 static mailstorage_driver db_mailstorage_driver = {
55 #ifdef _MSC_VER
55 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5656 /* sto_name */ "db",
5757 /* sto_connect */ db_mailstorage_connect,
5858 /* sto_get_folder_session */ db_mailstorage_get_folder_session,
2929 */
3030
3131 /*
32 * $Id: imapdriver.c,v 1.48 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: imapdriver.c,v 1.50 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "imapdriver.h"
125125 const char * uid,
126126 mailmessage ** result);
127127
128 static int imapdriver_login_sasl(mailsession * session,
129 const char * auth_type,
130 const char * server_fqdn,
131 const char * local_ip_port,
132 const char * remote_ip_port,
133 const char * login, const char * auth_name,
134 const char * password, const char * realm);
135
128136 static mailsession_driver local_imap_session_driver = {
129 #ifdef _MSC_VER
137 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
130138 /* sess_name */ "imap",
131139
132140 /* sess_initialize */ imapdriver_initialize,
172180 #if 0
173181 /* sess_search_messages */ imapdriver_search_messages,
174182 #endif
183 /* sess_login_sasl */ imapdriver_login_sasl,
175184
176185 #else
177186 .sess_name = "imap",
219228
220229 .sess_get_message = imapdriver_get_message,
221230 .sess_get_message_by_uid = imapdriver_get_message_by_uid,
231 .sess_login_sasl = imapdriver_login_sasl,
222232 #endif
223233 };
224234
12721282
12731283 return imapdriver_get_message(session, num, result);
12741284 }
1285
1286 static int imapdriver_login_sasl(mailsession * session,
1287 const char * auth_type,
1288 const char * server_fqdn,
1289 const char * local_ip_port,
1290 const char * remote_ip_port,
1291 const char * login, const char * auth_name,
1292 const char * password, const char * realm)
1293 {
1294 int r;
1295
1296 r = mailimap_authenticate(get_imap_session(session),
1297 auth_type, server_fqdn, local_ip_port, remote_ip_port,
1298 login, auth_name, password, realm);
1299
1300 return imap_error_to_mail_error(r);
1301 }
2929 */
3030
3131 /*
32 * $Id: imapdriver_cached.c,v 1.47 2005/06/01 16:04:41 hoa Exp $
32 * $Id: imapdriver_cached.c,v 1.49 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "imapdriver_cached.h"
135135 const char * uid,
136136 mailmessage ** result);
137137
138 static int imapdriver_cached_login_sasl(mailsession * session,
139 const char * auth_type,
140 const char * server_fqdn,
141 const char * local_ip_port,
142 const char * remote_ip_port,
143 const char * login, const char * auth_name,
144 const char * password, const char * realm);
145
138146 static mailsession_driver local_imap_cached_session_driver = {
139 #ifdef _MSC_VER
147 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
140148 /* sess_name */ "imap-cached",
141149
142150 /* sess_initialize */ imapdriver_cached_initialize,
182190 #if 0
183191 /* sess_search_messages */ imapdriver_cached_search_messages,
184192 #endif
193 /* sess_cached_login_sasl */ imapdriver_cached_login_sasl,
185194
186195 #else
187196 .sess_name = "imap-cached",
229238
230239 .sess_get_message = imapdriver_cached_get_message,
231240 .sess_get_message_by_uid = imapdriver_cached_get_message_by_uid,
241 .sess_login_sasl = imapdriver_cached_login_sasl,
232242 #endif
233243 };
234244
14211431
14221432 return imapdriver_cached_get_message(session, num, result);
14231433 }
1434
1435 static int imapdriver_cached_login_sasl(mailsession * session,
1436 const char * auth_type,
1437 const char * server_fqdn,
1438 const char * local_ip_port,
1439 const char * remote_ip_port,
1440 const char * login, const char * auth_name,
1441 const char * password, const char * realm)
1442 {
1443 return mailsession_login_sasl(get_ancestor(session), auth_type,
1444 server_fqdn,
1445 local_ip_port,
1446 remote_ip_port,
1447 login, auth_name,
1448 password, realm);
1449 }
2929 */
3030
3131 /*
32 * $Id: imapdriver_cached_message.c,v 1.22 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: imapdriver_cached_message.c,v 1.23 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "imapdriver_cached_message.h"
101101 struct mail_flags ** result);
102102
103103 static mailmessage_driver local_imap_cached_message_driver = {
104 #ifdef _MSC_VER
104 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
105105 /* msg_name */ "imap-cached",
106106
107107 /* msg_initialize */ imap_initialize,
2929 */
3030
3131 /*
32 * $Id: imapdriver_message.c,v 1.21 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: imapdriver_message.c,v 1.22 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "imapdriver_message.h"
9696 static void imap_check(mailmessage * msg_info);
9797
9898 static mailmessage_driver local_imap_message_driver = {
99 #ifdef _MSC_VER
99 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
100100 /* msg_name */ "imap",
101101
102102 /* msg_initialize */ imap_initialize,
2929 */
3030
3131 /*
32 * $Id: imapdriver_types.h,v 1.22 2004/11/21 21:53:32 hoa Exp $
32 * $Id: imapdriver_types.h,v 1.23 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef IMAPDRIVER_TYPES_H
115115 int imap_connection_type;
116116
117117 int imap_auth_type;
118 char * imap_login;
119 char * imap_password;
118 char * imap_login; /* deprecated */
119 char * imap_password; /* deprecated */
120120
121121 int imap_cached;
122122 char * imap_cache_directory;
123
124 struct {
125 int sasl_enabled;
126 char * sasl_auth_type;
127 char * sasl_server_fqdn;
128 char * sasl_local_ip_port;
129 char * sasl_remote_ip_port;
130 char * sasl_login;
131 char * sasl_auth_name;
132 char * sasl_password;
133 char * sasl_realm;
134 } imap_sasl;
123135 };
124136
125137 /* this is the type of IMAP4rev1 authentication */
2929 */
3030
3131 /*
32 * $Id: imapstorage.c,v 1.12 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: imapstorage.c,v 1.14 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "imapstorage.h"
5555 static void imap_mailstorage_uninitialize(struct mailstorage * storage);
5656
5757 static mailstorage_driver imap_mailstorage_driver = {
58 #ifdef _MSC_VER
58 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5959 /* sto_name */ "imap",
6060 /* sto_connect */ imap_mailstorage_connect,
6161 /* sto_get_folder_session */ imap_mailstorage_get_folder_session,
7777 int imap_cached, char * imap_cache_directory)
7878 {
7979 struct imap_mailstorage * imap_storage;
80 int r;
81
82 r = imap_mailstorage_init_sasl(storage,
83 imap_servername, imap_port,
84 imap_command,
85 imap_connection_type,
86 NULL,
87 NULL,
88 NULL, NULL,
89 imap_login, imap_login,
90 imap_password, NULL,
91 imap_cached, imap_cache_directory);
92
93 if (r == MAIL_NO_ERROR) {
94 imap_storage = storage->sto_data;
95 imap_storage->imap_auth_type = imap_auth_type;
96 imap_storage->imap_login = imap_storage->imap_sasl.sasl_login;
97 imap_storage->imap_password = imap_storage->imap_sasl.sasl_password;
98 }
99
100 return r;
101 }
102
103 LIBETPAN_EXPORT
104 int imap_mailstorage_init_sasl(struct mailstorage * storage,
105 char * imap_servername, uint16_t imap_port,
106 char * imap_command,
107 int imap_connection_type,
108 const char * auth_type,
109 const char * server_fqdn,
110 const char * local_ip_port,
111 const char * remote_ip_port,
112 const char * login, const char * auth_name,
113 const char * password, const char * realm,
114 int imap_cached, char * imap_cache_directory)
115 {
116 struct imap_mailstorage * imap_storage;
80117
81118 imap_storage = malloc(sizeof(* imap_storage));
82119 if (imap_storage == NULL)
116153 else
117154 imap_storage->imap_command = NULL;
118155
119 imap_storage->imap_auth_type = imap_auth_type;
120
121 if (imap_login != NULL) {
122 imap_storage->imap_login = strdup(imap_login);
123 if (imap_storage->imap_login == NULL)
156 imap_storage->imap_auth_type = IMAP_AUTH_TYPE_PLAIN;
157
158 imap_storage->imap_sasl.sasl_enabled = (auth_type != NULL);
159
160 if (auth_type != NULL) {
161 imap_storage->imap_sasl.sasl_auth_type = strdup(auth_type);
162 if (imap_storage->imap_sasl.sasl_auth_type == NULL)
124163 goto free_command;
125164 }
126165 else
127 imap_storage->imap_login = NULL;
128
129 if (imap_password != NULL) {
130 imap_storage->imap_password = strdup(imap_password);
131 if (imap_storage->imap_password == NULL)
166 imap_storage->imap_sasl.sasl_auth_type = NULL;
167
168 if (server_fqdn != NULL) {
169 imap_storage->imap_sasl.sasl_server_fqdn = strdup(server_fqdn);
170 if (imap_storage->imap_sasl.sasl_server_fqdn == NULL)
171 goto free_auth_type;
172 }
173 else
174 imap_storage->imap_sasl.sasl_server_fqdn = NULL;
175
176 if (local_ip_port != NULL) {
177 imap_storage->imap_sasl.sasl_local_ip_port = strdup(local_ip_port);
178 if (imap_storage->imap_sasl.sasl_local_ip_port == NULL)
179 goto free_server_fqdn;
180 }
181 else
182 imap_storage->imap_sasl.sasl_local_ip_port = NULL;
183
184 if (remote_ip_port != NULL) {
185 imap_storage->imap_sasl.sasl_remote_ip_port = strdup(remote_ip_port);
186 if (imap_storage->imap_sasl.sasl_remote_ip_port == NULL)
187 goto free_local_ip_port;
188 }
189 else
190 imap_storage->imap_sasl.sasl_remote_ip_port = NULL;
191
192 if (login != NULL) {
193 imap_storage->imap_sasl.sasl_login = strdup(login);
194 if (imap_storage->imap_sasl.sasl_login == NULL)
195 goto free_remote_ip_port;
196 }
197 else
198 imap_storage->imap_sasl.sasl_login = NULL;
199
200 if (auth_name != NULL) {
201 imap_storage->imap_sasl.sasl_auth_name = strdup(auth_name);
202 if (imap_storage->imap_sasl.sasl_auth_name == NULL)
132203 goto free_login;
133204 }
134205 else
135 imap_storage->imap_password = NULL;
206 imap_storage->imap_sasl.sasl_auth_name = NULL;
207
208 if (password != NULL) {
209 imap_storage->imap_sasl.sasl_password = strdup(password);
210 if (imap_storage->imap_sasl.sasl_password == NULL)
211 goto free_auth_name;
212 }
213 else
214 imap_storage->imap_sasl.sasl_password = NULL;
215
216 if (realm != NULL) {
217 imap_storage->imap_sasl.sasl_realm = strdup(realm);
218 if (imap_storage->imap_sasl.sasl_realm == NULL)
219 goto free_password;
220 }
221 else
222 imap_storage->imap_sasl.sasl_realm = NULL;
136223
137224 imap_storage->imap_cached = imap_cached;
138225
139226 if (imap_cached && (imap_cache_directory != NULL)) {
140227 imap_storage->imap_cache_directory = strdup(imap_cache_directory);
141228 if (imap_storage->imap_cache_directory == NULL)
142 goto free_password;
229 goto free_realm;
143230 }
144231 else {
145232 imap_storage->imap_cached = FALSE;
151238
152239 return MAIL_NO_ERROR;
153240
241 free_realm:
242 free(imap_storage->imap_sasl.sasl_realm);
154243 free_password:
155 free(imap_storage->imap_password);
244 free(imap_storage->imap_sasl.sasl_password);
245 free_auth_name:
246 free(imap_storage->imap_sasl.sasl_auth_name);
156247 free_login:
157 free(imap_storage->imap_login);
248 free(imap_storage->imap_sasl.sasl_login);
249 free_remote_ip_port:
250 free(imap_storage->imap_sasl.sasl_remote_ip_port);
251 free_local_ip_port:
252 free(imap_storage->imap_sasl.sasl_local_ip_port);
253 free_server_fqdn:
254 free(imap_storage->imap_sasl.sasl_server_fqdn);
255 free_auth_type:
256 free(imap_storage->imap_sasl.sasl_auth_type);
158257 free_command:
159258 free(imap_storage->imap_command);
160259 free_servername:
173272
174273 if (imap_storage->imap_cache_directory != NULL)
175274 free(imap_storage->imap_cache_directory);
176 if (imap_storage->imap_password != NULL)
177 free(imap_storage->imap_password);
178 if (imap_storage->imap_login != NULL)
179 free(imap_storage->imap_login);
275
276 free(imap_storage->imap_sasl.sasl_realm);
277 free(imap_storage->imap_sasl.sasl_password);
278 free(imap_storage->imap_sasl.sasl_auth_name);
279 free(imap_storage->imap_sasl.sasl_login);
280 free(imap_storage->imap_sasl.sasl_remote_ip_port);
281 free(imap_storage->imap_sasl.sasl_local_ip_port);
282 free(imap_storage->imap_sasl.sasl_server_fqdn);
283 free(imap_storage->imap_sasl.sasl_auth_type);
284
180285 if (imap_storage->imap_command != NULL)
181286 free(imap_storage->imap_command);
182287 free(imap_storage->imap_servername);
200305 driver = imap_cached_session_driver;
201306 else
202307 driver = imap_session_driver;
203
308
204309 r = mailstorage_generic_connect(driver,
205310 imap_storage->imap_servername,
206311 imap_storage->imap_port,
220325 goto err;
221326 }
222327
223 r = mailstorage_generic_auth(session, r,
224 imap_storage->imap_connection_type,
225 imap_storage->imap_login,
226 imap_storage->imap_password);
328 if (imap_storage->imap_sasl.sasl_enabled) {
329 r = mailstorage_generic_auth_sasl(session, r,
330 imap_storage->imap_sasl.sasl_auth_type,
331 imap_storage->imap_sasl.sasl_server_fqdn,
332 imap_storage->imap_sasl.sasl_local_ip_port,
333 imap_storage->imap_sasl.sasl_remote_ip_port,
334 imap_storage->imap_sasl.sasl_login,
335 imap_storage->imap_sasl.sasl_auth_name,
336 imap_storage->imap_sasl.sasl_password,
337 imap_storage->imap_sasl.sasl_realm);
338 }
339 else {
340 r = mailstorage_generic_auth(session, r,
341 imap_storage->imap_auth_type,
342 imap_storage->imap_sasl.sasl_login,
343 imap_storage->imap_sasl.sasl_password);
344 }
227345 if (r != MAIL_NO_ERROR) {
228346 res = r;
229347 goto free;
2929 */
3030
3131 /*
32 * $Id: imapstorage.h,v 1.10 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: imapstorage.h,v 1.11 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef IMAPSTORAGE_H
8383 char * imap_login, char * imap_password,
8484 int imap_cached, char * imap_cache_directory);
8585
86 LIBETPAN_EXPORT
87 int imap_mailstorage_init_sasl(struct mailstorage * storage,
88 char * imap_servername, uint16_t imap_port,
89 char * imap_command,
90 int imap_connection_type,
91 const char * auth_type,
92 const char * server_fqdn,
93 const char * local_ip_port,
94 const char * remote_ip_port,
95 const char * login, const char * auth_name,
96 const char * password, const char * realm,
97 int imap_cached, char * imap_cache_directory);
98
8699 #ifdef __cplusplus
87100 }
88101 #endif
2929 */
3030
3131 /*
32 * $Id: maildirdriver.c,v 1.10 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: maildirdriver.c,v 1.12 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535
104104
105105 static mailsession_driver local_maildir_session_driver = {
106106
107 #ifdef _MSC_VER
107 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
108108
109109 /* sess_name */ "maildir",
110110
151151 #if 0
152152 /* sess_search_messages */ maildriver_generic_search_messages,
153153 #endif
154 /* sess_login_sasl */ NULL,
154155
155156 #else
156157 .sess_name = "maildir",
198199
199200 .sess_get_message = NULL,
200201 .sess_get_message_by_uid = get_message_by_uid,
202 .sess_login_sasl = NULL,
201203
202204 #endif
203205 };
2929 */
3030
3131 /*
32 * $Id: maildirdriver_cached.c,v 1.12 2005/06/01 16:04:41 hoa Exp $
32 * $Id: maildirdriver_cached.c,v 1.14 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "maildirdriver.h"
105105 const char * uid, mailmessage ** result);
106106
107107 static mailsession_driver local_maildir_cached_session_driver = {
108 #ifdef _MSC_VER
108 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
109109 /* sess_name */ "maildir-cached",
110110
111111 /* sess_initialize */ initialize,
151151 #if 0
152152 /* sess_search_messages */ maildriver_generic_search_messages,
153153 #endif
154 /* sess_login_sasl */ NULL,
154155
155156 #else
156157 .sess_name = "maildir-cached",
198199
199200 .sess_get_message = get_message,
200201 .sess_get_message_by_uid = get_message_by_uid,
202 .sess_login_sasl = NULL,
201203 #endif
202204 };
203205
2929 */
3030
3131 /*
32 * $Id: maildirdriver_cached_message.c,v 1.6 2005/06/01 20:23:15 hoa Exp $
32 * $Id: maildirdriver_cached_message.c,v 1.7 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "maildirdriver_message.h"
7373 static void check(mailmessage * msg_info);
7474
7575 static mailmessage_driver local_maildir_cached_message_driver = {
76 #ifdef _MSC_VER
76 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
7777 /* msg_name */ "maildir-cached",
7878
7979 /* msg_initialize */ initialize,
2929 */
3030
3131 /*
32 * $Id: maildirdriver_message.c,v 1.6 2005/06/01 20:23:15 hoa Exp $
32 * $Id: maildirdriver_message.c,v 1.7 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "maildirdriver_message.h"
7373 static void check(mailmessage * msg_info);
7474
7575 static mailmessage_driver local_maildir_message_driver = {
76 #ifdef _MSC_VER
76 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
7777 /* msg_name */ "maildir",
7878
7979 /* msg_initialize */ initialize,
2929 */
3030
3131 /*
32 * $Id: maildirstorage.c,v 1.6 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: maildirstorage.c,v 1.7 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "maildirstorage.h"
5353 static void maildir_mailstorage_uninitialize(struct mailstorage * storage);
5454
5555 static mailstorage_driver maildir_mailstorage_driver = {
56 #ifdef _MSC_VER
56 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5757 /* sto_name */ "maildir",
5858 /* sto_connect */ maildir_mailstorage_connect,
5959 /* sto_get_folder_session */ maildir_mailstorage_get_folder_session,
2929 */
3030
3131 /*
32 * $Id: mboxdriver.c,v 1.38 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: mboxdriver.c,v 1.40 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "mboxdriver.h"
100100 mailmessage ** result);
101101
102102 static mailsession_driver local_mbox_session_driver = {
103 #ifdef _MSC_VER
103 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
104104 /* sess_name */ "mbox",
105105
106106 /* sess_initialize */ mboxdriver_initialize,
147147 #if 0
148148 /* sess_search_messages */ maildriver_generic_search_messages,
149149 #endif
150 /* sess_login_sasl */ NULL,
150151
151152 #else
152153 .sess_name = "mbox",
194195
195196 .sess_get_message = mboxdriver_get_message,
196197 .sess_get_message_by_uid = mboxdriver_get_message_by_uid,
198 .sess_login_sasl = NULL,
197199 #endif
198200 };
199201
2929 */
3030
3131 /*
32 * $Id: mboxdriver_cached.c,v 1.48 2005/06/19 21:02:07 hoa Exp $
32 * $Id: mboxdriver_cached.c,v 1.50 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "mboxdriver_cached.h"
111111 mailmessage ** result);
112112
113113 static mailsession_driver local_mbox_cached_session_driver = {
114 #ifdef _MSC_VER
114 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
115115 /* sess_name */ "mbox-cached",
116116
117117 /* sess_initialize */ mboxdriver_cached_initialize,
158158 #if 0
159159 /* sess_search_messages */ maildriver_generic_search_messages,
160160 #endif
161 /* sess_login_sasl */ NULL,
161162
162163 #else
163164 .sess_name = "mbox-cached",
206207
207208 .sess_get_message = mboxdriver_cached_get_message,
208209 .sess_get_message_by_uid = mboxdriver_cached_get_message_by_uid,
210 .sess_login_sasl = NULL,
209211 #endif
210212 };
211213
2929 */
3030
3131 /*
32 * $Id: mboxdriver_cached_message.c,v 1.22 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: mboxdriver_cached_message.c,v 1.23 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mboxdriver_cached_message.h"
7777 size_t * result_len);
7878
7979 static mailmessage_driver local_mbox_cached_message_driver = {
80 #ifdef _MSC_VER
80 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
8181 /* msg_name */ "mbox-cached",
8282
8383 /* msg_initialize */ mbox_initialize,
2929 */
3030
3131 /*
32 * $Id: mboxdriver_message.c,v 1.16 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: mboxdriver_message.c,v 1.17 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mboxdriver_message.h"
6565 size_t * result_len);
6666
6767 static mailmessage_driver local_mbox_message_driver = {
68 #ifdef _MSC_VER
68 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
6969 /* msg_name */ "mbox",
7070
7171 /* msg_initialize */ mbox_initialize,
2929 */
3030
3131 /*
32 * $Id: mboxstorage.c,v 1.9 2005/06/01 12:21:58 smarinier Exp $
32 * $Id: mboxstorage.c,v 1.10 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mboxstorage.h"
5252 static void mbox_mailstorage_uninitialize(struct mailstorage * storage);
5353
5454 static mailstorage_driver mbox_mailstorage_driver = {
55 #ifdef _MSC_VER
55 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5656 /* sto_name */ "mbox",
5757 /* sto_connect */ mbox_mailstorage_connect,
5858 /* sto_get_folder_session */ mbox_mailstorage_get_folder_session,
2929 */
3030
3131 /*
32 * $Id: mhdriver.c,v 1.29 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: mhdriver.c,v 1.31 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "mhdriver.h"
111111 mailmessage ** result);
112112
113113 static mailsession_driver local_mh_session_driver = {
114 #ifdef _MSC_VER
114 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
115115 /* sess_name */ "mh",
116116
117117 /* sess_initialize */ mhdriver_initialize,
157157 #if 0
158158 /* sess_search_messages */ maildriver_generic_search_messages,
159159 #endif
160 /* sess_login_sasl */ NULL,
160161
161162 #else
162163 .sess_name = "mh",
204205
205206 .sess_get_message = mhdriver_get_message,
206207 .sess_get_message_by_uid = mhdriver_get_message_by_uid,
208 .sess_login_sasl = NULL,
207209 #endif
208210 };
209211
2929 */
3030
3131 /*
32 * $Id: mhdriver_cached.c,v 1.41 2005/06/01 16:04:43 hoa Exp $
32 * $Id: mhdriver_cached.c,v 1.43 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "mhdriver_cached.h"
138138 mailmessage ** result);
139139
140140 static mailsession_driver local_mh_cached_session_driver = {
141 #ifdef _MSC_VER
141 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
142142 /* sess_name */ "mh-cached",
143143
144144 /* sess_initialize */ mhdriver_cached_initialize,
184184 #if 0
185185 /* sess_search_messages */ maildriver_generic_search_messages,
186186 #endif
187 /* sess_login_sasl */ NULL,
187188
188189 #else
189190 .sess_name = "mh-cached",
231232
232233 .sess_get_message = mhdriver_cached_get_message,
233234 .sess_get_message_by_uid = mhdriver_cached_get_message_by_uid,
235 .sess_login_sasl = NULL,
234236 #endif
235237 };
236238
2929 */
3030
3131 /*
32 * $Id: mhdriver_cached_message.c,v 1.21 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: mhdriver_cached_message.c,v 1.22 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mhdriver_message.h"
7777 size_t * result_len);
7878
7979 static mailmessage_driver local_mh_cached_message_driver = {
80 #ifdef _MSC_VER
80 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
8181 /* msg_name */ "mh-cached",
8282
8383 /* msg_initialize */ mh_initialize,
2929 */
3030
3131 /*
32 * $Id: mhdriver_message.c,v 1.19 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: mhdriver_message.c,v 1.20 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mhdriver_message.h"
6565 size_t * result_len);
6666
6767 static mailmessage_driver local_mh_message_driver = {
68 #ifdef _MSC_VER
68 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
6969 /* msg_name */ "mh",
7070
7171 /* msg_initialize */ mh_initialize,
2929 */
3030
3131 /*
32 * $Id: mhstorage.c,v 1.9 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: mhstorage.c,v 1.10 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mhstorage.h"
4949 static void mh_mailstorage_uninitialize(struct mailstorage * storage);
5050
5151 static mailstorage_driver mh_mailstorage_driver = {
52 #ifdef _MSC_VER
52 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5353 /* sto_name */ "mh",
5454 /* sto_connect */ mh_mailstorage_connect,
5555 /* sto_get_folder_session */ mh_mailstorage_get_folder_session,
2929 */
3030
3131 /*
32 * $Id: mime_message_driver.c,v 1.9 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: mime_message_driver.c,v 1.10 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mime_message_driver.h"
889889
890890
891891 static mailmessage_driver local_mime_message_driver = {
892 #ifdef _MSC_VER
892 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
893893 /* msg_name */ "mime",
894894
895895 /* msg_initialize */ initialize,
2929 */
3030
3131 /*
32 * $Id: nntpdriver.c,v 1.46 2005/06/01 16:04:43 hoa Exp $
32 * $Id: nntpdriver.c,v 1.48 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "nntpdriver.h"
9999 static int nntpdriver_noop(mailsession * session);
100100
101101 static mailsession_driver local_nntp_session_driver = {
102 #ifdef _MSC_VER
102 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
103103 /* sess_name */ "nntp",
104104
105105 /* sess_initialize */ nntpdriver_initialize,
145145 #if 0
146146 /* sess_search_messages */ maildriver_generic_search_messages,
147147 #endif
148 /* sess_login_sasl */ NULL,
148149
149150 #else
150151 .sess_name = "nntp",
192193
193194 .sess_get_message = nntpdriver_get_message,
194195 .sess_get_message_by_uid = nntpdriver_get_message_by_uid,
196 .sess_login_sasl = NULL,
195197 #endif
196198 };
197199
2929 */
3030
3131 /*
32 * $Id: nntpdriver_cached.c,v 1.48 2005/06/01 20:23:15 hoa Exp $
32 * $Id: nntpdriver_cached.c,v 1.50 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "nntpdriver_cached.h"
139139 mailmessage ** result);
140140
141141 static mailsession_driver local_nntp_cached_session_driver = {
142 #ifdef _MSC_VER
142 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
143143 /* sess_name */ "nntp-cached",
144144
145145 /* sess_initialize */ nntpdriver_cached_initialize,
185185 #if 0
186186 /* sess_search_messages */ maildriver_generic_search_messages,
187187 #endif
188 /* sess_login_sasl */ NULL,
188189
189190 #else
190191 .sess_name = "nntp-cached",
232233
233234 .sess_get_message = nntpdriver_cached_get_message,
234235 .sess_get_message_by_uid = nntpdriver_cached_get_message_by_uid,
236 .sess_login_sasl = NULL,
235237 #endif
236238 };
237239
2929 */
3030
3131 /*
32 * $Id: nntpdriver_cached_message.c,v 1.16 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: nntpdriver_cached_message.c,v 1.17 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "nntpdriver_cached_message.h"
7070 struct mail_flags ** result);
7171
7272 static mailmessage_driver local_nntp_cached_message_driver = {
73 #ifdef _MSC_VER
73 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
7474 /* msg_name */ "nntp-cached",
7575
7676 /* msg_initialize */ nntp_initialize,
2929 */
3030
3131 /*
32 * $Id: nntpdriver_message.c,v 1.12 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: nntpdriver_message.c,v 1.13 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "nntpdriver_message.h"
5555 size_t * result);
5656
5757 static mailmessage_driver local_nntp_message_driver = {
58 #ifdef _MSC_VER
58 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5959
6060 /* msg_name */ "nntp",
6161
2929 */
3030
3131 /*
32 * $Id: nntpstorage.c,v 1.12 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: nntpstorage.c,v 1.13 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "nntpstorage.h"
5454 static void nntp_mailstorage_uninitialize(struct mailstorage * storage);
5555
5656 static mailstorage_driver nntp_mailstorage_driver = {
57 #ifdef _MSC_VER
57 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5858 /* sto_name */ "nntp",
5959 /* sto_connect */ nntp_mailstorage_connect,
6060 /* sto_get_folder_session */ nntp_mailstorage_get_folder_session,
2929 */
3030
3131 /*
32 * $Id: pop3driver.c,v 1.31 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: pop3driver.c,v 1.34 2005/08/22 10:13:49 smarinier Exp $
3333 */
3434
3535 #include "pop3driver.h"
7575 static int pop3driver_get_message(mailsession * session,
7676 uint32_t num, mailmessage ** result);
7777
78 static int pop3driver_login_sasl(mailsession * session,
79 const char * auth_type,
80 const char * server_fqdn,
81 const char * local_ip_port,
82 const char * remote_ip_port,
83 const char * login, const char * auth_name,
84 const char * password, const char * realm);
85
7886 static mailsession_driver local_pop3_session_driver = {
79 #ifdef _MSC_VER
87 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
8088
8189 /* sess_name */ "pop3",
8290
123131 #if 0
124132 /* sess_search_messages */ maildriver_generic_search_messages,
125133 #endif
126
134 /* sess_login_sasl */ pop3driver_login_sasl,
135
127136 #else
128137 .sess_name = "pop3",
129138
170179
171180 .sess_get_message = pop3driver_get_message,
172181 .sess_get_message_by_uid = NULL,
182 .sess_login_sasl = pop3driver_login_sasl,
173183 #endif
174184 };
175185
435445
436446 return MAIL_NO_ERROR;
437447 }
448
449 static int pop3driver_login_sasl(mailsession * session,
450 const char * auth_type,
451 const char * server_fqdn,
452 const char * local_ip_port,
453 const char * remote_ip_port,
454 const char * login, const char * auth_name,
455 const char * password, const char * realm)
456 {
457 int r;
458
459 r = mailpop3_auth(get_pop3_session(session),
460 auth_type, server_fqdn, local_ip_port, remote_ip_port,
461 login, auth_name, password, realm);
462
463 return pop3driver_pop3_error_to_mail_error(r);
464 }
2929 */
3030
3131 /*
32 * $Id: pop3driver_cached.c,v 1.42 2005/06/01 12:21:59 smarinier Exp $
32 * $Id: pop3driver_cached.c,v 1.44 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "pop3driver_cached.h"
114114 static int pop3driver_cached_get_message_by_uid(mailsession * session,
115115 const char * uid, mailmessage ** result);
116116
117 static int pop3driver_cached_login_sasl(mailsession * session,
118 const char * auth_type,
119 const char * server_fqdn,
120 const char * local_ip_port,
121 const char * remote_ip_port,
122 const char * login, const char * auth_name,
123 const char * password, const char * realm);
124
117125 static mailsession_driver local_pop3_cached_session_driver = {
118 #ifdef _MSC_VER
126 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
119127 /* sess_name */ "pop3-cached",
120128
121129 /* sess_initialize */ pop3driver_cached_initialize,
161169 #if 0
162170 /* sess_search_messages */ maildriver_generic_search_messages,
163171 #endif
164
172 /* sess_login_sasl */ pop3driver_cached_login_sasl,
173
165174 #else
166175 .sess_name = "pop3-cached",
167176
208217
209218 .sess_get_message = pop3driver_cached_get_message,
210219 .sess_get_message_by_uid = pop3driver_cached_get_message_by_uid,
220 .sess_login_sasl = pop3driver_cached_login_sasl,
211221 #endif
212222 };
213223
947957
948958 return pop3driver_cached_get_message(session, msg_info->msg_index, result);
949959 }
960
961 static int pop3driver_cached_login_sasl(mailsession * session,
962 const char * auth_type,
963 const char * server_fqdn,
964 const char * local_ip_port,
965 const char * remote_ip_port,
966 const char * login, const char * auth_name,
967 const char * password, const char * realm)
968 {
969 return mailsession_login_sasl(get_ancestor(session), auth_type,
970 server_fqdn,
971 local_ip_port,
972 remote_ip_port,
973 login, auth_name,
974 password, realm);
975 }
2929 */
3030
3131 /*
32 * $Id: pop3driver_cached_message.c,v 1.17 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: pop3driver_cached_message.c,v 1.18 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "pop3driver_cached_message.h"
7070 static void pop3_uninitialize(mailmessage * msg_info);
7171
7272 static mailmessage_driver local_pop3_cached_message_driver = {
73 #ifdef _MSC_VER
73 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
7474 /* msg_name */ "pop3-cached",
7575
7676 /* msg_initialize */ pop3_initialize,
2929 */
3030
3131 /*
32 * $Id: pop3driver_message.c,v 1.11 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: pop3driver_message.c,v 1.12 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "pop3driver_message.h"
5555 size_t * result);
5656
5757 static mailmessage_driver local_pop3_message_driver = {
58 #ifdef _MSC_VER
58 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5959 /* msg_name */ "pop3",
6060
6161 /* msg_initialize */ pop3_initialize,
2929 */
3030
3131 /*
32 * $Id: pop3driver_types.h,v 1.7 2004/11/21 21:53:34 hoa Exp $
32 * $Id: pop3driver_types.h,v 1.8 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef POP3DRIVER_TYPES_H
121121 int pop3_connection_type;
122122
123123 int pop3_auth_type;
124 char * pop3_login;
125 char * pop3_password;
124 char * pop3_login; /* deprecated */
125 char * pop3_password; /* deprecated */
126126
127127 int pop3_cached;
128128 char * pop3_cache_directory;
129129 char * pop3_flags_directory;
130
131 struct {
132 int sasl_enabled;
133 char * sasl_auth_type;
134 char * sasl_server_fqdn;
135 char * sasl_local_ip_port;
136 char * sasl_remote_ip_port;
137 char * sasl_login;
138 char * sasl_auth_name;
139 char * sasl_password;
140 char * sasl_realm;
141 } pop3_sasl;
130142 };
131143
132144 /* this is the type of POP3 authentication */
2929 */
3030
3131 /*
32 * $Id: pop3storage.c,v 1.12 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: pop3storage.c,v 1.14 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "pop3storage.h"
5252 static void pop3_mailstorage_uninitialize(struct mailstorage * storage);
5353
5454 static mailstorage_driver pop3_mailstorage_driver = {
55 #ifdef _MSC_VER
55 #if defined (_MSC_VER) || defined (__SUNPRO_CC)
5656 /* sto_name */ "pop3",
5757 /* sto_connect */ pop3_mailstorage_connect,
5858 /* sto_get_folder_session */ pop3_mailstorage_get_folder_session,
7474 int pop3_cached, char * pop3_cache_directory, char * pop3_flags_directory)
7575 {
7676 struct pop3_mailstorage * pop3_storage;
77 int r;
78
79 r = pop3_mailstorage_init_sasl(storage,
80 pop3_servername, pop3_port,
81 pop3_command,
82 pop3_connection_type,
83 NULL,
84 NULL,
85 NULL, NULL,
86 pop3_login, pop3_login,
87 pop3_password, NULL,
88 pop3_cached, pop3_cache_directory,
89 pop3_flags_directory);
90
91 if (r == MAIL_NO_ERROR) {
92 pop3_storage = storage->sto_data;
93 pop3_storage->pop3_auth_type = pop3_auth_type;
94 pop3_storage->pop3_login = pop3_storage->pop3_sasl.sasl_login;
95 pop3_storage->pop3_password = pop3_storage->pop3_sasl.sasl_password;
96 }
97
98 return r;
99 }
100
101 LIBETPAN_EXPORT
102 int pop3_mailstorage_init_sasl(struct mailstorage * storage,
103 char * pop3_servername, uint16_t pop3_port,
104 char * pop3_command,
105 int pop3_connection_type,
106 const char * auth_type,
107 const char * server_fqdn,
108 const char * local_ip_port,
109 const char * remote_ip_port,
110 const char * login, const char * auth_name,
111 const char * password, const char * realm,
112 int pop3_cached, char * pop3_cache_directory,
113 char * pop3_flags_directory)
114 {
115 struct pop3_mailstorage * pop3_storage;
77116
78117 pop3_storage = malloc(sizeof(* pop3_storage));
79118 if (pop3_storage == NULL)
113152 else
114153 pop3_storage->pop3_command = NULL;
115154
116 pop3_storage->pop3_auth_type = pop3_auth_type;
117
118 if (pop3_login != NULL) {
119 pop3_storage->pop3_login = strdup(pop3_login);
120 if (pop3_storage->pop3_login == NULL)
155 pop3_storage->pop3_auth_type = POP3_AUTH_TYPE_PLAIN;
156
157 pop3_storage->pop3_sasl.sasl_enabled = (auth_type != NULL);
158
159 if (auth_type != NULL) {
160 pop3_storage->pop3_sasl.sasl_auth_type = strdup(auth_type);
161 if (pop3_storage->pop3_sasl.sasl_auth_type == NULL)
121162 goto free_command;
122163 }
123164 else
124 pop3_storage->pop3_login = NULL;
125
126 if (pop3_password != NULL) {
127 pop3_storage->pop3_password = strdup(pop3_password);
128 if (pop3_storage->pop3_password == NULL)
165 pop3_storage->pop3_sasl.sasl_auth_type = NULL;
166
167 if (server_fqdn != NULL) {
168 pop3_storage->pop3_sasl.sasl_server_fqdn = strdup(server_fqdn);
169 if (pop3_storage->pop3_sasl.sasl_server_fqdn == NULL)
170 goto free_auth_type;
171 }
172 else
173 pop3_storage->pop3_sasl.sasl_server_fqdn = NULL;
174
175 if (local_ip_port != NULL) {
176 pop3_storage->pop3_sasl.sasl_local_ip_port = strdup(local_ip_port);
177 if (pop3_storage->pop3_sasl.sasl_local_ip_port == NULL)
178 goto free_server_fqdn;
179 }
180 else
181 pop3_storage->pop3_sasl.sasl_local_ip_port = NULL;
182
183 if (remote_ip_port != NULL) {
184 pop3_storage->pop3_sasl.sasl_remote_ip_port = strdup(remote_ip_port);
185 if (pop3_storage->pop3_sasl.sasl_remote_ip_port == NULL)
186 goto free_local_ip_port;
187 }
188 else
189 pop3_storage->pop3_sasl.sasl_remote_ip_port = NULL;
190
191 if (login != NULL) {
192 pop3_storage->pop3_sasl.sasl_login = strdup(login);
193 if (pop3_storage->pop3_sasl.sasl_login == NULL)
194 goto free_remote_ip_port;
195 }
196 else
197 pop3_storage->pop3_sasl.sasl_login = NULL;
198
199 if (auth_name != NULL) {
200 pop3_storage->pop3_sasl.sasl_auth_name = strdup(auth_name);
201 if (pop3_storage->pop3_sasl.sasl_auth_name == NULL)
129202 goto free_login;
130203 }
131204 else
132 pop3_storage->pop3_password = NULL;
133
205 pop3_storage->pop3_sasl.sasl_auth_name = NULL;
206
207 if (password != NULL) {
208 pop3_storage->pop3_sasl.sasl_password = strdup(password);
209 if (pop3_storage->pop3_sasl.sasl_password == NULL)
210 goto free_auth_name;
211 }
212 else
213 pop3_storage->pop3_sasl.sasl_password = NULL;
214
215 if (realm != NULL) {
216 pop3_storage->pop3_sasl.sasl_realm = strdup(realm);
217 if (pop3_storage->pop3_sasl.sasl_realm == NULL)
218 goto free_password;
219 }
220 else
221 pop3_storage->pop3_sasl.sasl_realm = NULL;
222
134223 pop3_storage->pop3_cached = pop3_cached;
135224
136225 if (pop3_cached && (pop3_cache_directory != NULL) &&
137226 (pop3_flags_directory != NULL)) {
138227 pop3_storage->pop3_cache_directory = strdup(pop3_cache_directory);
139228 if (pop3_storage->pop3_cache_directory == NULL)
140 goto free_password;
229 goto free_realm;
141230 pop3_storage->pop3_flags_directory = strdup(pop3_flags_directory);
142231 if (pop3_storage->pop3_flags_directory == NULL)
143232 goto free_cache_directory;
155244
156245 free_cache_directory:
157246 free(pop3_storage->pop3_cache_directory);
247 free_realm:
248 free(pop3_storage->pop3_sasl.sasl_realm);
158249 free_password:
159 if (pop3_storage->pop3_password != NULL)
160 free(pop3_storage->pop3_password);
250 free(pop3_storage->pop3_sasl.sasl_password);
251 free_auth_name:
252 free(pop3_storage->pop3_sasl.sasl_auth_name);
161253 free_login:
162 if (pop3_storage->pop3_login != NULL)
163 free(pop3_storage->pop3_login);
254 free(pop3_storage->pop3_sasl.sasl_login);
255 free_remote_ip_port:
256 free(pop3_storage->pop3_sasl.sasl_remote_ip_port);
257 free_local_ip_port:
258 free(pop3_storage->pop3_sasl.sasl_local_ip_port);
259 free_server_fqdn:
260 free(pop3_storage->pop3_sasl.sasl_server_fqdn);
261 free_auth_type:
262 free(pop3_storage->pop3_sasl.sasl_auth_type);
164263 free_command:
165264 if (pop3_storage->pop3_command != NULL)
166265 free(pop3_storage->pop3_command);
183282 free(pop3_storage->pop3_flags_directory);
184283 if (pop3_storage->pop3_cache_directory != NULL)
185284 free(pop3_storage->pop3_cache_directory);
186 if (pop3_storage->pop3_password != NULL)
187 free(pop3_storage->pop3_password);
188 if (pop3_storage->pop3_login != NULL)
189 free(pop3_storage->pop3_login);
285
286 free(pop3_storage->pop3_sasl.sasl_realm);
287 free(pop3_storage->pop3_sasl.sasl_password);
288 free(pop3_storage->pop3_sasl.sasl_auth_name);
289 free(pop3_storage->pop3_sasl.sasl_login);
290 free(pop3_storage->pop3_sasl.sasl_remote_ip_port);
291 free(pop3_storage->pop3_sasl.sasl_local_ip_port);
292 free(pop3_storage->pop3_sasl.sasl_server_fqdn);
293 free(pop3_storage->pop3_sasl.sasl_auth_type);
294
190295 if (pop3_storage->pop3_command != NULL)
191296 free(pop3_storage->pop3_command);
192297 free(pop3_storage->pop3_servername);
247352 mailsession_parameters(session, POP3DRIVER_SET_AUTH_TYPE, &auth_type);
248353 }
249354
250 r = mailstorage_generic_auth(session, r,
251 pop3_storage->pop3_auth_type,
252 pop3_storage->pop3_login,
253 pop3_storage->pop3_password);
355 if (pop3_storage->pop3_sasl.sasl_enabled) {
356 r = mailstorage_generic_auth_sasl(session, r,
357 pop3_storage->pop3_sasl.sasl_auth_type,
358 pop3_storage->pop3_sasl.sasl_server_fqdn,
359 pop3_storage->pop3_sasl.sasl_local_ip_port,
360 pop3_storage->pop3_sasl.sasl_remote_ip_port,
361 pop3_storage->pop3_sasl.sasl_login,
362 pop3_storage->pop3_sasl.sasl_auth_name,
363 pop3_storage->pop3_sasl.sasl_password,
364 pop3_storage->pop3_sasl.sasl_realm);
365 }
366 else {
367 r = mailstorage_generic_auth(session, r,
368 pop3_storage->pop3_auth_type,
369 pop3_storage->pop3_sasl.sasl_login,
370 pop3_storage->pop3_sasl.sasl_password);
371 }
254372 if (r != MAIL_NO_ERROR) {
255373 if (pop3_storage->pop3_auth_type == POP3_AUTH_TYPE_TRY_APOP) {
256374 /* try in clear authentication */
2929 */
3030
3131 /*
32 * $Id: pop3storage.h,v 1.9 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: pop3storage.h,v 1.10 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef POP3STORAGE_H
8888 int pop3_cached, char * pop3_cache_directory,
8989 char * pop3_flags_directory);
9090
91 LIBETPAN_EXPORT
92 int pop3_mailstorage_init_sasl(struct mailstorage * storage,
93 char * pop3_servername, uint16_t pop3_port,
94 char * pop3_command,
95 int pop3_connection_type,
96 const char * auth_type,
97 const char * server_fqdn,
98 const char * local_ip_port,
99 const char * remote_ip_port,
100 const char * login, const char * auth_name,
101 const char * password, const char * realm,
102 int pop3_cached, char * pop3_cache_directory,
103 char * pop3_flags_directory);
104
91105 #ifdef __cplusplus
92106 }
93107 #endif
2929 */
3030
3131 /*
32 * $Id: maildriver.c,v 1.24 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: maildriver.c,v 1.25 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "maildriver.h"
415415
416416 return session->sess_driver->sess_get_message_by_uid(session, uid, result);
417417 }
418
419 LIBETPAN_EXPORT
420 int mailsession_login_sasl(mailsession * session, const char * auth_type,
421 const char * server_fqdn,
422 const char * local_ip_port,
423 const char * remote_ip_port,
424 const char * login, const char * auth_name,
425 const char * password, const char * realm)
426 {
427 if (session->sess_driver->sess_login_sasl == NULL)
428 return MAIL_ERROR_NOT_IMPLEMENTED;
429
430 return session->sess_driver->sess_login_sasl(session, auth_type,
431 server_fqdn,
432 local_ip_port,
433 remote_ip_port,
434 login, auth_name,
435 password, realm);
436 }
2929 */
3030
3131 /*
32 * $Id: maildriver.h,v 1.32 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: maildriver.h,v 1.33 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef MAILDRIVER_H
573573 int mailsession_get_message_by_uid(mailsession * session,
574574 const char * uid, mailmessage ** result);
575575
576
577 /*
578 mailsession_login notifies the SASL authentication information
579 to the session
580
581 @param auth_type type of SASL authentication
582 @param server_fqdn server full qualified domain name
583 @param local_ip_port local IP:port (client)
584 @param remote_ip_port remote IP:port (server)
585 @param login login
586 @param auth_name authentication name
587 @param password password
588 @param realm realm
589
590 @return MAIL_NO_ERROR is returned on success, MAIL_ERROR_XXX is returned
591 on error
592 */
593
594 LIBETPAN_EXPORT
595 int mailsession_login_sasl(mailsession * session, const char * auth_type,
596 const char * server_fqdn,
597 const char * local_ip_port,
598 const char * remote_ip_port,
599 const char * login, const char * auth_name,
600 const char * password, const char * realm);
601
576602 #ifdef __cplusplus
577603 }
578604 #endif
2929 */
3030
3131 /*
32 * $Id: maildriver_types.h,v 1.42 2005/06/01 12:22:00 smarinier Exp $
32 * $Id: maildriver_types.h,v 1.43 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #ifndef MAILDRIVER_TYPES_H
457457 STARTTLS.
458458 - get_message_by_uid() so that the application can remember the message
459459 by UID and build its own list of messages.
460 - login_sasl() notifies the SASL information to authenticate to the
461 session.
460462
461463 * drivers' specific :
462464
542544 struct mail_search_key * key,
543545 struct mail_search_result ** result);
544546 #endif
547
548 int (* sess_login_sasl)(mailsession * session, const char * auth_type,
549 const char * server_fqdn,
550 const char * local_ip_port,
551 const char * remote_ip_port,
552 const char * login, const char * auth_name,
553 const char * password, const char * realm);
545554 };
546555
547556
2929 */
3030
3131 /*
32 * $Id: mailstorage_tools.c,v 1.15 2005/06/01 12:22:01 smarinier Exp $
32 * $Id: mailstorage_tools.c,v 1.18 2005/08/15 11:08:40 hoa Exp $
3333 */
3434
3535 #include "mailstorage_tools.h"
101101 /* SEB unsupported on Windows */
102102 #ifndef WIN32
103103
104 #define ENV_BUFFER_SIZE 512
105
104106 static void do_exec_command(int fd, const char *command,
105107 char *servername, uint16_t port)
106108 {
107109 int i, maxopen;
110 #ifdef SOLARIS
111 char env_buffer[ENV_BUFFER_SIZE];
112 #endif
108113
109114 if (fork() > 0) {
110115 /* Fork again to become a child of init rather than
112117 exit(0);
113118 }
114119
120 #ifdef SOLARIS
121 if (servername)
122 snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANSERVER=%s", servername);
123 else
124 snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANSERVER=");
125 putenv(env_buffer);
126 #else
115127 if (servername)
116128 setenv("ETPANSERVER", servername, 1);
117129 else
118130 unsetenv("ETPANSERVER");
119
131 #endif
132
133 #ifdef SOLARIS
134 if (port)
135 snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANPORT=%d", port);
136 else
137 snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANPORT=");
138 putenv(env_buffer);
139 #else
120140 if (port) {
121141 char porttext[20];
122142
126146 else {
127147 unsetenv("ETPANPORT");
128148 }
149 #endif
129150
130151 /* Not a lot we can do if there's an error other than bail. */
131152 if (dup2(fd, 0) == -1)
387408 err:
388409 return res;
389410 }
411
412 int mailstorage_generic_auth_sasl(mailsession * session,
413 int connect_result,
414 const char * auth_type,
415 const char * server_fqdn,
416 const char * local_ip_port,
417 const char * remote_ip_port,
418 const char * login, const char * auth_name,
419 const char * password, const char * realm)
420 {
421 int must_auth;
422 int r;
423 int res;
424
425 r = connect_result;
426
427 must_auth = FALSE;
428 switch (r) {
429 case MAIL_NO_ERROR_NON_AUTHENTICATED:
430 must_auth = TRUE;
431 break;
432 case MAIL_NO_ERROR_AUTHENTICATED:
433 case MAIL_NO_ERROR:
434 break;
435 default:
436 res = r;
437 goto err;
438 }
439
440 if (must_auth) {
441 r = mailsession_login_sasl(session, auth_type,
442 server_fqdn,
443 local_ip_port,
444 remote_ip_port,
445 login, auth_name,
446 password, realm);
447 if (r != MAIL_NO_ERROR) {
448 mailsession_logout(session);
449 res = r;
450 goto err;
451 }
452 }
453
454 return MAIL_NO_ERROR;
455
456 err:
457 return res;
458 }
2929 */
3030
3131 /*
32 * $Id: mailstorage_tools.h,v 1.6 2004/11/21 21:53:35 hoa Exp $
32 * $Id: mailstorage_tools.h,v 1.7 2005/08/15 11:08:41 hoa Exp $
3333 */
3434
3535 #include "mailstorage.h"
5959 char * login,
6060 char * password);
6161
62 int mailstorage_generic_auth_sasl(mailsession * session,
63 int connect_result,
64 const char * auth_type,
65 const char * server_fqdn,
66 const char * local_ip_port,
67 const char * remote_ip_port,
68 const char * login, const char * auth_name,
69 const char * password, const char * realm);
70
6271 #ifdef __cplusplus
6372 }
6473 #endif
2929 */
3030
3131 /*
32 * $Id: mailprivacy_gnupg.c,v 1.4 2004/12/27 14:08:25 hoa Exp $
32 * $Id: mailprivacy_gnupg.c,v 1.5 2005/08/13 14:59:42 hoa Exp $
3333 */
3434
3535 #include "mailprivacy_gnupg.h"
25392539 return res;
25402540 }
25412541
2542
2542 #if defined (_MSC_VER) || defined ( __SUNPRO_CC)
2543 static struct mailprivacy_encryption pgp_encryption_tab[] = {
2544 /* PGP signed part */
2545 {
2546 /* name */ "signed",
2547 /* description */ "PGP signed part",
2548 /* encrypt */ pgp_sign_mime,
2549 },
2550
2551 /* pgp encrypted part */
2552
2553 {
2554 /* name */ "encrypted",
2555 /* description */ "PGP encrypted part",
2556 /* encrypt */ pgp_encrypt_mime,
2557 },
2558
2559 /* PGP signed & encrypted part */
2560
2561 {
2562 /* name */ "signed-encrypted",
2563 /* description */ "PGP signed & encrypted part",
2564 /* encrypt */ pgp_sign_encrypt_mime,
2565 },
2566
2567 /* PGP clear signed part */
2568
2569 {
2570 /* name */ "clear-signed",
2571 /* description */ "PGP clear signed part",
2572 /* encrypt */ pgp_clear_sign,
2573 },
2574
2575 /* PGP armor encrypted part */
2576
2577 {
2578 /* name */ "encrypted-armor",
2579 /* description */ "PGP ASCII armor encrypted part",
2580 /* encrypt */ pgp_armor_encrypt,
2581 },
2582
2583 /* PGP armor signed & encrypted part */
2584
2585 {
2586 /* name */ "signed-encrypted-armor",
2587 /* description */ "PGP ASCII armor signed & encrypted part",
2588 /* encrypt */ pgp_armor_sign_encrypt,
2589 },
2590 };
2591 #else
25432592 static struct mailprivacy_encryption pgp_encryption_tab[] = {
25442593 /* PGP signed part */
25452594 {
25482597 .encrypt = pgp_sign_mime,
25492598 },
25502599
2551 /* PGP encrypted part */
2600 /* pgp encrypted part */
25522601
25532602 {
25542603 .name = "encrypted",
25882637 .encrypt = pgp_armor_sign_encrypt,
25892638 },
25902639 };
2591
2640 #endif
2641
2642 #if defined (_MSC_VER) || defined ( __SUNPRO_CC)
2643 static struct mailprivacy_protocol pgp_protocol = {
2644 /* name */ "pgp",
2645 /* description */ "OpenPGP",
2646
2647 /* is_encrypted */ pgp_test_encrypted,
2648 /* decrypt */ pgp_handler,
2649
2650 /* encryption_count */
2651 (sizeof(pgp_encryption_tab) / sizeof(pgp_encryption_tab[0])),
2652
2653 /* encryption_tab */ pgp_encryption_tab,
2654 };
2655 #else
25922656 static struct mailprivacy_protocol pgp_protocol = {
25932657 .name = "pgp",
25942658 .description = "OpenPGP",
26012665
26022666 .encryption_tab = pgp_encryption_tab,
26032667 };
2668 #endif
26042669
26052670 int mailprivacy_gnupg_init(struct mailprivacy * privacy)
26062671 {
2929 */
3030
3131 /*
32 * $Id: mailprivacy_smime.c,v 1.6 2005/06/01 16:04:44 hoa Exp $
32 * $Id: mailprivacy_smime.c,v 1.9 2005/08/16 23:31:24 hoa Exp $
3333 */
3434
3535 #include "mailprivacy_smime.h"
7171 static int smime_is_signed(struct mailmime * mime)
7272 {
7373 if (mime->mm_content_type != NULL) {
74 clistiter * cur;
75
76 for(cur = clist_begin(mime->mm_content_type->ct_parameters) ; cur != NULL ;
77 cur = clist_next(cur)) {
78 struct mailmime_parameter * param;
79
80 param = cur->data;
81
82 if ((strcasecmp(param->pa_name, "protocol") == 0) &&
83 ((strcasecmp(param->pa_value, "application/x-pkcs7-signature") == 0) ||
84 (strcasecmp(param->pa_value, "application/pkcs7-signature") == 0)))
85 return 1;
86 }
87 }
88
74 if ((strcasecmp(mime->mm_content_type->ct_subtype, "x-pkcs7-mime") == 0) ||
75 (strcasecmp(mime->mm_content_type->ct_subtype, "pkcs7-mime") == 0)) {
76 clistiter * cur;
77
78 for(cur = clist_begin(mime->mm_content_type->ct_parameters) ;
79 cur != NULL ;
80 cur = clist_next(cur)) {
81 struct mailmime_parameter * param;
82
83 param = cur->data;
84
85 if ((strcasecmp(param->pa_name, "smime-type") == 0) &&
86 (strcasecmp(param->pa_value, "signed-data") == 0))
87 return 1;
88 }
89
90 return 0;
91 }
92 else {
93 clistiter * cur;
94
95 for(cur = clist_begin(mime->mm_content_type->ct_parameters) ;
96 cur != NULL ;
97 cur = clist_next(cur)) {
98 struct mailmime_parameter * param;
99
100 param = cur->data;
101
102 if ((strcasecmp(param->pa_name, "protocol") == 0) &&
103 ((strcasecmp(param->pa_value,
104 "application/x-pkcs7-signature") == 0) ||
105 (strcasecmp(param->pa_value,
106 "application/pkcs7-signature") == 0)))
107 return 1;
108 }
109 }
110 }
111
89112 return 0;
90113 }
91114
93116 {
94117 if (mime->mm_content_type != NULL) {
95118 if ((strcasecmp(mime->mm_content_type->ct_subtype, "x-pkcs7-mime") == 0) ||
96 (strcasecmp(mime->mm_content_type->ct_subtype, "pkcs7-mime") == 0))
119 (strcasecmp(mime->mm_content_type->ct_subtype, "pkcs7-mime") == 0)) {
120 clistiter * cur;
121
122 for(cur = clist_begin(mime->mm_content_type->ct_parameters) ;
123 cur != NULL ;
124 cur = clist_next(cur)) {
125 struct mailmime_parameter * param;
126
127 param = cur->data;
128
129 if ((strcasecmp(param->pa_name, "smime-type") == 0) &&
130 (strcasecmp(param->pa_value, "signed-data") == 0))
131 return 0;
132 }
133
97134 return 1;
98 }
99
135 }
136 }
137
100138 return 0;
101139 }
102140
594632
595633 /* insert the signed part */
596634 if (!sign_ok) {
597 clistiter * child_iter;
598 struct mailmime * child;
599
600 child_iter = clist_begin(mime->mm_data.mm_multipart.mm_mp_list);
601 child = clist_content(child_iter);
602
603 r = mailprivacy_fetch_mime_body_to_file(privacy,
604 stripped_filename, sizeof(stripped_filename),
605 msg, child);
635 if (mime->mm_type == MAILMIME_MULTIPLE) {
636 clistiter * child_iter;
637 struct mailmime * child;
638
639 child_iter = clist_begin(mime->mm_data.mm_multipart.mm_mp_list);
640 child = clist_content(child_iter);
641
642 r = mailprivacy_fetch_mime_body_to_file(privacy,
643 stripped_filename, sizeof(stripped_filename),
644 msg, child);
645 }
606646 }
607647
608648 r = mailprivacy_get_part_from_file(privacy, 1,
651691 return smime_is_signed(mime);
652692
653693 case MAILMIME_SINGLE:
654 return smime_is_encrypted(mime);
694 return smime_is_encrypted(mime) || smime_is_signed(mime);
655695 }
656696
657697 return 0;
682722 r = MAIL_ERROR_INVAL;
683723 if (smime_is_encrypted(mime))
684724 r = smime_decrypt(privacy, msg, mime, &alternative_mime);
725 else if (smime_is_signed(mime))
726 r = smime_verify(privacy, msg, mime, &alternative_mime);
685727
686728 if (r != MAIL_NO_ERROR)
687729 return r;
13111353 }
13121354
13131355
1314
1356 #if defined (_MSC_VER) || defined ( __SUNPRO_CC)
1357 static struct mailprivacy_encryption smime_encryption_tab[] = {
1358 /* S/MIME signed part */
1359 {
1360 /* name */ "signed",
1361 /* description */ "S/MIME signed part",
1362 /* encrypt */ smime_sign,
1363 },
1364
1365 /* S/MIME encrypted part */
1366
1367 {
1368 /* name */ "encrypted",
1369 /* description */ "S/MIME encrypted part",
1370 /* encrypt */ smime_encrypt,
1371 },
1372
1373 /* S/MIME signed & encrypted part */
1374
1375 {
1376 /* name */ "signed-encrypted",
1377 /* description */ "S/MIME signed & encrypted part",
1378 /* encrypt */ smime_sign_encrypt,
1379 },
1380 };
1381 #else
13151382 static struct mailprivacy_encryption smime_encryption_tab[] = {
13161383 /* S/MIME signed part */
13171384 {
13361403 .encrypt = smime_sign_encrypt,
13371404 },
13381405 };
1339
1406 #endif
1407
1408 #if defined (_MSC_VER) || defined ( __SUNPRO_CC)
1409 static struct mailprivacy_protocol smime_protocol = {
1410 /* name */ "smime",
1411 /* description */ "S/MIME",
1412
1413 /* is_encrypted */ smime_test_encrypted,
1414 /* decrypt */ smime_handler,
1415
1416 /* encryption_count */
1417 (sizeof(smime_encryption_tab) / sizeof(smime_encryption_tab[0])),
1418
1419 /* encryption_tab */ smime_encryption_tab,
1420 };
1421 #else
13401422 static struct mailprivacy_protocol smime_protocol = {
13411423 .name = "smime",
13421424 .description = "S/MIME",
13491431
13501432 .encryption_tab = smime_encryption_tab,
13511433 };
1434 #endif
13521435
13531436 int mailprivacy_smime_init(struct mailprivacy * privacy)
13541437 {
2929 */
3030
3131 /*
32 * $Id: mailmbox.c,v 1.41 2005/06/01 16:04:46 hoa Exp $
32 * $Id: mailmbox.c,v 1.42 2005/08/13 14:52:23 hoa Exp $
3333 */
3434
3535 #include "mailmbox.h"
5757 #include "mailmbox_parse.h"
5858 #include "maillock.h"
5959
60 #if 0
61 #define CRLF_BADNESS
62 #endif
63
6064 /*
6165 http://www.qmail.org/qmail-manual-html/man5/mbox.html
6266 RFC 2076
6367 */
6468
69 /* used only in case the directory which contains the original file
70 is not writable */
6571 #define TMPDIR "/tmp"
6672
6773 /* mbox is a file with a corresponding filename */
447453 if (!force_no_uid) {
448454 /* UID header */
449455
456 #ifdef CRLF_BADNESS
450457 fixed_size += strlen(UID_HEADER " \r\n");
458 #else
459 fixed_size += strlen(UID_HEADER " \n");
460 #endif
451461
452462 tmp_uid = uid;
453463 while (tmp_uid >= 10) {
559569
560570 memcpy(str, UID_HEADER " ", strlen(UID_HEADER " "));
561571 str += strlen(UID_HEADER " ");
572 #ifdef CRLF_BADNESS
562573 numlen = snprintf(str, 20, "%i\r\n", uid);
574 #else
575 numlen = snprintf(str, 20, "%i\n", uid);
576 #endif
563577 str += numlen;
564578 }
565579
610624 date = time(NULL);
611625 from_size = strlen(DEFAULT_FROM_LINE);
612626 if (localtime_r(&date, &time_info) != NULL)
627 #ifdef CRLF_BADNESS
628 from_size = strftime(from_line, MAX_FROM_LINE_SIZE, "From - %c\r\n", &time_info);
629 #else
613630 from_size = strftime(from_line, MAX_FROM_LINE_SIZE, "From - %c\n", &time_info);
631 #endif
614632
615633 maxuid = /* */ folder->mb_max_uid;
616634
623641 extra_size += get_fixed_message_size(info->ai_message, info->ai_size,
624642 folder->mb_max_uid + i + 1,
625643 folder->mb_no_uid);
644 #ifdef CRLF_BADNESS
626645 extra_size += 2; /* CR LF */
646 #else
647 extra_size += 1; /* CR LF */
648 #endif
627649
628650 info->ai_uid = folder->mb_max_uid + i + 1;
629651 }
635657 crlf_count ++;
636658 left --;
637659 }
660 #ifdef CRLF_BADNESS
638661 else if (folder->mb_mapping[left - 1] == '\r') {
639662 left --;
640663 }
664 #endif
641665 else
642666 break;
643667
650674
651675 if (old_size != 0) {
652676 if (crlf_count != 2)
677 #ifdef CRLF_BADNESS
653678 extra_size += (2 - crlf_count) * 2;
679 #else
680 /* Need the number of LFs, not CRLFs */
681 extra_size += (2 - crlf_count) * 1;
682 #endif
654683 }
655684
656685 r = ftruncate(folder->mb_fd, extra_size + old_size);
670699
671700 if (old_size != 0) {
672701 for(i = 0 ; i < 2 - crlf_count ; i ++) {
702 #ifdef CRLF_BADNESS
673703 * str = '\r';
674704 str ++;
705 #endif
675706 * str = '\n';
676707 str ++;
677708 }
690721 folder->mb_max_uid + i + 1,
691722 folder->mb_no_uid);
692723
724 #ifdef CRLF_BADNESS
693725 * str = '\r';
694726 str ++;
727 #endif
695728 * str = '\n';
696729 str ++;
697730 }
11471180 if (!info->msg_written_uid) {
11481181 uint32_t uid;
11491182
1183 #ifdef CRLF_BADNESS
11501184 size += strlen(UID_HEADER " \r\n");
1185 #else
1186 size += strlen(UID_HEADER " \n");
1187 #endif
11511188
11521189 uid = info->msg_uid;
11531190 while (uid >= 10) {
11891226
11901227 memcpy(dest + cur_offset, UID_HEADER " ", strlen(UID_HEADER " "));
11911228 cur_offset += strlen(UID_HEADER " ");
1229 #ifdef CRLF_BADNESS
11921230 numlen = snprintf(dest + cur_offset, size - cur_offset,
11931231 "%i\r\n", info->msg_uid);
1232 #else
1233 numlen = snprintf(dest + cur_offset, size - cur_offset,
1234 "%i\n", info->msg_uid);
1235 #endif
11941236 cur_offset += numlen;
11951237 }
11961238 }
3131 */
3232
3333 /*
34 * $Id: mailsmtp.c,v 1.20 2005/07/16 17:55:57 hoa Exp $
34 * $Id: mailsmtp.c,v 1.21 2005/08/13 14:52:23 hoa Exp $
3535 */
3636
3737 #ifndef CONFIG_H
4141
4242 #include "mailsmtp.h"
4343 #include "connect.h"
44 #include "md5.h"
4544 #include "base64.h"
4645 #include "mail.h"
4746
2929 */
3030
3131 /*
32 * $Id: mailsmtp.h,v 1.17 2005/07/16 17:55:57 hoa Exp $
32 * $Id: mailsmtp.h,v 1.18 2005/08/22 10:09:45 smarinier Exp $
3333 */
3434
3535 #ifndef MAILSMTP_H
4646 #include <libetpan/mailsmtp_ssl.h>
4747
4848
49 LIBETPAN_EXPORT
4950 mailsmtp * mailsmtp_new(size_t progr_rate,
5051 progress_function * progr_fun);
52
53 LIBETPAN_EXPORT
5154 void mailsmtp_free(mailsmtp * session);
5255
56 LIBETPAN_EXPORT
5357 int mailsmtp_connect(mailsmtp * session, mailstream * s);
58
59 LIBETPAN_EXPORT
5460 int mailsmtp_quit(mailsmtp * session);
5561
5662
5965 * Tries AUTH with detected method - "better" method first:
6066 * CRAM-MD5 -> PLAIN -> LOGIN
6167 */
68 LIBETPAN_EXPORT
6269 int mailsmtp_auth(mailsmtp * session, const char * user, const char * pass);
6370
6471 /* This call is deprecated and mailesmtp_auth_sasl() should be used instead */
6673 * tries to autenticate with the server using given auth-type
6774 * returns MAILSMTP_NO_ERROR on success
6875 */
76 LIBETPAN_EXPORT
6977 int mailsmtp_auth_type(mailsmtp * session,
7078 const char * user, const char * pass, int type);
7179
80 LIBETPAN_EXPORT
7281 int mailsmtp_helo(mailsmtp * session);
82
83 LIBETPAN_EXPORT
7384 int mailsmtp_mail(mailsmtp * session, const char * from);
85
86 LIBETPAN_EXPORT
7487 int mailsmtp_rcpt(mailsmtp * session, const char * to);
88
89 LIBETPAN_EXPORT
7590 int mailsmtp_data(mailsmtp * session);
91
92 LIBETPAN_EXPORT
7693 int mailsmtp_data_message(mailsmtp * session,
7794 const char * message,
7895 size_t size);
96
97 LIBETPAN_EXPORT
7998 int mailesmtp_ehlo(mailsmtp * session);
99
100 LIBETPAN_EXPORT
80101 int mailesmtp_mail(mailsmtp * session,
81102 const char * from,
82103 int return_full,
83104 const char * envid);
105
106 LIBETPAN_EXPORT
84107 int mailesmtp_rcpt(mailsmtp * session,
85108 const char * to,
86109 int notify,
87110 const char * orcpt);
111
112 LIBETPAN_EXPORT
88113 int mailesmtp_starttls(mailsmtp * session);
89114
115 LIBETPAN_EXPORT
90116 const char * mailsmtp_strerror(int errnum);
91117
118 LIBETPAN_EXPORT
92119 int mailesmtp_auth_sasl(mailsmtp * session, const char * auth_type,
93120 const char * server_fqdn,
94121 const char * local_ip_port,
2929 */
3030
3131 /*
32 * $Id: mailsmtp_socket.h,v 1.16 2005/06/01 20:23:23 hoa Exp $
32 * $Id: mailsmtp_socket.h,v 1.17 2005/08/22 10:09:45 smarinier Exp $
3333 */
3434
3535 #ifndef MAILSMTP_SOCKET_H
4343 #include <libetpan/libetpan-config.h>
4444 #include <libetpan/mailsmtp_types.h>
4545
46 LIBETPAN_EXPORT
4647 int mailsmtp_socket_connect(mailsmtp * session,
4748 const char * server, uint16_t port);
49
50 LIBETPAN_EXPORT
4851 int mailsmtp_socket_starttls(mailsmtp * session);
4952
5053 #ifdef __cplusplus
33 */
44
55 #include <libetpan/libetpan.h>
6 #include <netdb.h>
7 #include <netinet/in.h>
8 #include <sys/socket.h>
96 #include <stdlib.h>
107 #include <string.h>
118 #include <sys/types.h>
12 #include <sys/mman.h>
139 #include <sys/stat.h>
14 #include <unistd.h>
15 #include <sys/ioctl.h>
1610 #include <fcntl.h>
17 #include <pwd.h>
18
19 #define _GNU_SOURCE
20 #include <getopt.h>
11 #ifdef _MSC_VER
12 # include "win_etpan.h"
13 # include "../src/bsd/getopt.h"
14 # define STDIN_FILENO _fileno( stdin)
15 #else
16 # include <netdb.h>
17 # include <netinet/in.h>
18 # include <sys/socket.h>
19 # include <sys/mman.h>
20 # include <unistd.h>
21 # include <sys/ioctl.h>
22 # include <pwd.h>
23
24 # define _GNU_SOURCE
25 # include <getopt.h>
26 #endif
2127
2228 /* globals */
2329 char *smtp_server;
24 uint smtp_port = 25;
30 uint16_t smtp_port = 25;
2531 char *smtp_user;
2632 char *smtp_password;
2733 char *smtp_from;
4248
4349 memset(message, 0, sizeof(struct mem_message));
4450
51 #ifndef MMAP_UNAVAILABLE
4552 /* if stdin is a file whose size is known, try to mmap it */
4653 if (!fstat(0, &sb) && S_ISREG(sb.st_mode) && sb.st_size >= 0) {
4754 message->len = sb.st_size;
4956 STDIN_FILENO, 0)) != MAP_FAILED)
5057 return 0;
5158 }
59 #endif
5260
5361 /* read the buffer from stdin by blocks, until EOF or error.
5462 save the message in a mmap_string */
8391 }
8492
8593 char *guessfrom() {
94 #ifndef _MSC_VER
8695 uid_t uid;
8796 struct passwd *pw;
8897 char hostname[256];
110119 else
111120 snprintf(gfrom, len, "#%u@%s", uid, hostname);
112121 return gfrom;
122 #else
123 return NULL;
124 #endif
113125 }
114126
115127 void release(struct mem_message *message) {
116128 if (message->mstring != NULL)
117129 mmap_string_free(message->mstring);
130 #ifndef MMAP_UNAVAILABLE
118131 else if (message->data != NULL)
119132 munmap(message->data, message->len);
133 #endif
120134 }
121135
122136 int send_message(char *data, size_t len, char**rcpts) {
227241 smtp_server = strdup(optarg);
228242 break;
229243 case 'p':
230 smtp_port = strtoul(optarg, NULL, 10);
244 smtp_port = (uint16_t) strtoul(optarg, NULL, 10);
231245 break;
232246 case 'u':
233247 if (smtp_user != NULL)