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
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 | ||
0 | 99 | 2005-07-20 - libetpan-0.38 - hoa |
1 | 100 | |
2 | * release 0.37 - Deadwing | |
101 | * release 0.38 - Deadwing | |
3 | 102 | |
4 | 103 | * fixed SSL |
5 | 104 | * 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 | ||
0 | 7 | 2005-07-20 - libetpan-0.38 - hoa |
1 | 8 | |
2 | * release 0.37 - Deadwing | |
9 | * release 0.38 - Deadwing | |
3 | 10 | |
4 | 11 | * fixed SSL |
5 | 12 | * IMAP improvements |
1497 | 1497 | |
1498 | 1498 | |
1499 | 1499 | VERSION_MAJOR=0 |
1500 | VERSION_MINOR=38 | |
1501 | ||
1502 | API_CURRENT=3 | |
1500 | VERSION_MINOR=39 | |
1501 | ||
1502 | API_CURRENT=4 | |
1503 | 1503 | API_REVISION=0 |
1504 | 1504 | API_COMPATIBILITY=3 |
1505 | 1505 |
802 | 802 | Filter="h;hpp;hxx;hm;inl;inc;xsd" |
803 | 803 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> |
804 | 804 | <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"> | |
806 | 812 | </File> |
807 | 813 | </Filter> |
808 | 814 | <Filter |
5 | 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readmsg", "readmsg\readmsg.vcproj", "{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}" |
6 | 6 | ProjectSection(ProjectDependencies) = postProject |
7 | 7 | {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 | |
8 | 12 | EndProjectSection |
9 | 13 | EndProject |
10 | 14 | Global |
21 | 25 | {5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Debug.Build.0 = Debug|Win32 |
22 | 26 | {5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Release.ActiveCfg = Release|Win32 |
23 | 27 | {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 | |
24 | 32 | EndGlobalSection |
25 | 33 | GlobalSection(ExtensibilityGlobals) = postSolution |
26 | 34 | 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> |
2 | 2 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 | 3 | # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
4 | 4 | |
5 | timestamp='2005-04-22' | |
5 | timestamp='2005-08-03' | |
6 | 6 | |
7 | 7 | # This file is free software; you can redistribute it and/or modify it |
8 | 8 | # under the terms of the GNU General Public License as published by |
16 | 16 | # |
17 | 17 | # You should have received a copy of the GNU General Public License |
18 | 18 | # 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. | |
20 | 21 | # |
21 | 22 | # As a special exception to the GNU General Public License, if you |
22 | 23 | # distribute this file as part of a program that contains a |
23 | 24 | # configuration script generated by Autoconf, you may include it under |
24 | 25 | # the same distribution terms that you use for the rest of that program. |
26 | ||
25 | 27 | |
26 | 28 | # Originally written by Per Bothner <per@bothner.com>. |
27 | 29 | # Please send patches to <config-patches@gnu.org>. Submit a context |
65 | 67 | while test $# -gt 0 ; do |
66 | 68 | case $1 in |
67 | 69 | --time-stamp | --time* | -t ) |
68 | echo "$timestamp" ; exit 0 ;; | |
70 | echo "$timestamp" ; exit ;; | |
69 | 71 | --version | -v ) |
70 | echo "$version" ; exit 0 ;; | |
72 | echo "$version" ; exit ;; | |
71 | 73 | --help | --h* | -h ) |
72 | echo "$usage"; exit 0 ;; | |
74 | echo "$usage"; exit ;; | |
73 | 75 | -- ) # Stop option processing |
74 | 76 | shift; break ;; |
75 | 77 | - ) # Use stdin as input. |
122 | 124 | ;; |
123 | 125 | ,,*) CC_FOR_BUILD=$CC ;; |
124 | 126 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; |
125 | esac ;' | |
127 | esac ; set_cc_for_build= ;' | |
126 | 128 | |
127 | 129 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. |
128 | 130 | # (ghazi@noc.rutgers.edu 1994-08-24) |
195 | 197 | # contains redundant information, the shorter form: |
196 | 198 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
197 | 199 | 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 ;; | |
235 | 201 | *: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 ;; | |
238 | 205 | *:ekkoBSD:*:*) |
239 | 206 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
240 | exit 0 ;; | |
207 | exit ;; | |
241 | 208 | macppc:MirBSD:*:*) |
242 | 209 | echo powerppc-unknown-mirbsd${UNAME_RELEASE} |
243 | exit 0 ;; | |
210 | exit ;; | |
244 | 211 | *:MirBSD:*:*) |
245 | 212 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} |
246 | exit 0 ;; | |
213 | exit ;; | |
247 | 214 | alpha:OSF1:*:*) |
248 | 215 | case $UNAME_RELEASE in |
249 | 216 | *4.0) |
296 | 263 | # A Xn.n version is an unreleased experimental baselevel. |
297 | 264 | # 1.2 uses "1.2" for uname -r. |
298 | 265 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
299 | exit 0 ;; | |
266 | exit ;; | |
300 | 267 | Alpha\ *:Windows_NT*:*) |
301 | 268 | # How do we know it's Interix rather than the generic POSIX subsystem? |
302 | 269 | # Should we change UNAME_MACHINE based on the output of uname instead |
303 | 270 | # of the specific Alpha model? |
304 | 271 | echo alpha-pc-interix |
305 | exit 0 ;; | |
272 | exit ;; | |
306 | 273 | 21064:Windows_NT:50:3) |
307 | 274 | echo alpha-dec-winnt3.5 |
308 | exit 0 ;; | |
275 | exit ;; | |
309 | 276 | Amiga*:UNIX_System_V:4.0:*) |
310 | 277 | echo m68k-unknown-sysv4 |
311 | exit 0;; | |
278 | exit ;; | |
312 | 279 | *:[Aa]miga[Oo][Ss]:*:*) |
313 | 280 | echo ${UNAME_MACHINE}-unknown-amigaos |
314 | exit 0 ;; | |
281 | exit ;; | |
315 | 282 | *:[Mm]orph[Oo][Ss]:*:*) |
316 | 283 | echo ${UNAME_MACHINE}-unknown-morphos |
317 | exit 0 ;; | |
284 | exit ;; | |
318 | 285 | *:OS/390:*:*) |
319 | 286 | echo i370-ibm-openedition |
320 | exit 0 ;; | |
287 | exit ;; | |
321 | 288 | *:z/VM:*:*) |
322 | 289 | echo s390-ibm-zvmoe |
323 | exit 0 ;; | |
290 | exit ;; | |
324 | 291 | *:OS400:*:*) |
325 | 292 | echo powerpc-ibm-os400 |
326 | exit 0 ;; | |
293 | exit ;; | |
327 | 294 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
328 | 295 | echo arm-acorn-riscix${UNAME_RELEASE} |
329 | exit 0;; | |
296 | exit ;; | |
297 | arm:riscos:*:*|arm:RISCOS:*:*) | |
298 | echo arm-unknown-riscos | |
299 | exit ;; | |
330 | 300 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
331 | 301 | echo hppa1.1-hitachi-hiuxmpp |
332 | exit 0;; | |
302 | exit ;; | |
333 | 303 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) |
334 | 304 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. |
335 | 305 | if test "`(/bin/universe) 2>/dev/null`" = att ; then |
337 | 307 | else |
338 | 308 | echo pyramid-pyramid-bsd |
339 | 309 | fi |
340 | exit 0 ;; | |
310 | exit ;; | |
341 | 311 | NILE*:*:*:dcosx) |
342 | 312 | echo pyramid-pyramid-svr4 |
343 | exit 0 ;; | |
313 | exit ;; | |
344 | 314 | DRS?6000:unix:4.0:6*) |
345 | 315 | echo sparc-icl-nx6 |
346 | exit 0 ;; | |
316 | exit ;; | |
347 | 317 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) |
348 | 318 | case `/usr/bin/uname -p` in |
349 | sparc) echo sparc-icl-nx7 && exit 0 ;; | |
319 | sparc) echo sparc-icl-nx7; exit ;; | |
350 | 320 | esac ;; |
351 | 321 | sun4H:SunOS:5.*:*) |
352 | 322 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
353 | exit 0 ;; | |
323 | exit ;; | |
354 | 324 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) |
355 | 325 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
356 | exit 0 ;; | |
326 | exit ;; | |
357 | 327 | i86pc:SunOS:5.*:*) |
358 | 328 | echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
359 | exit 0 ;; | |
329 | exit ;; | |
360 | 330 | sun4*:SunOS:6*:*) |
361 | 331 | # According to config.sub, this is the proper way to canonicalize |
362 | 332 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but |
363 | 333 | # it's likely to be more like Solaris than SunOS4. |
364 | 334 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
365 | exit 0 ;; | |
335 | exit ;; | |
366 | 336 | sun4*:SunOS:*:*) |
367 | 337 | case "`/usr/bin/arch -k`" in |
368 | 338 | Series*|S4*) |
371 | 341 | esac |
372 | 342 | # Japanese Language versions have a version number like `4.1.3-JL'. |
373 | 343 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` |
374 | exit 0 ;; | |
344 | exit ;; | |
375 | 345 | sun3*:SunOS:*:*) |
376 | 346 | echo m68k-sun-sunos${UNAME_RELEASE} |
377 | exit 0 ;; | |
347 | exit ;; | |
378 | 348 | sun*:*:4.2BSD:*) |
379 | 349 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` |
380 | 350 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 |
386 | 356 | echo sparc-sun-sunos${UNAME_RELEASE} |
387 | 357 | ;; |
388 | 358 | esac |
389 | exit 0 ;; | |
359 | exit ;; | |
390 | 360 | aushp:SunOS:*:*) |
391 | 361 | echo sparc-auspex-sunos${UNAME_RELEASE} |
392 | exit 0 ;; | |
362 | exit ;; | |
393 | 363 | # The situation for MiNT is a little confusing. The machine name |
394 | 364 | # can be virtually everything (everything which is not |
395 | 365 | # "atarist" or "atariste" at least should have a processor |
400 | 370 | # be no problem. |
401 | 371 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
402 | 372 | echo m68k-atari-mint${UNAME_RELEASE} |
403 | exit 0 ;; | |
373 | exit ;; | |
404 | 374 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
405 | 375 | echo m68k-atari-mint${UNAME_RELEASE} |
406 | exit 0 ;; | |
376 | exit ;; | |
407 | 377 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
408 | 378 | echo m68k-atari-mint${UNAME_RELEASE} |
409 | exit 0 ;; | |
379 | exit ;; | |
410 | 380 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
411 | 381 | echo m68k-milan-mint${UNAME_RELEASE} |
412 | exit 0 ;; | |
382 | exit ;; | |
413 | 383 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
414 | 384 | echo m68k-hades-mint${UNAME_RELEASE} |
415 | exit 0 ;; | |
385 | exit ;; | |
416 | 386 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
417 | 387 | echo m68k-unknown-mint${UNAME_RELEASE} |
418 | exit 0 ;; | |
388 | exit ;; | |
419 | 389 | m68k:machten:*:*) |
420 | 390 | echo m68k-apple-machten${UNAME_RELEASE} |
421 | exit 0 ;; | |
391 | exit ;; | |
422 | 392 | powerpc:machten:*:*) |
423 | 393 | echo powerpc-apple-machten${UNAME_RELEASE} |
424 | exit 0 ;; | |
394 | exit ;; | |
425 | 395 | RISC*:Mach:*:*) |
426 | 396 | echo mips-dec-mach_bsd4.3 |
427 | exit 0 ;; | |
397 | exit ;; | |
428 | 398 | RISC*:ULTRIX:*:*) |
429 | 399 | echo mips-dec-ultrix${UNAME_RELEASE} |
430 | exit 0 ;; | |
400 | exit ;; | |
431 | 401 | VAX*:ULTRIX*:*:*) |
432 | 402 | echo vax-dec-ultrix${UNAME_RELEASE} |
433 | exit 0 ;; | |
403 | exit ;; | |
434 | 404 | 2020:CLIX:*:* | 2430:CLIX:*:*) |
435 | 405 | echo clipper-intergraph-clix${UNAME_RELEASE} |
436 | exit 0 ;; | |
406 | exit ;; | |
437 | 407 | mips:*:*:UMIPS | mips:*:*:RISCos) |
438 | 408 | eval $set_cc_for_build |
439 | 409 | sed 's/^ //' << EOF >$dummy.c |
457 | 427 | exit (-1); |
458 | 428 | } |
459 | 429 | 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; } | |
463 | 434 | echo mips-mips-riscos${UNAME_RELEASE} |
464 | exit 0 ;; | |
435 | exit ;; | |
465 | 436 | Motorola:PowerMAX_OS:*:*) |
466 | 437 | echo powerpc-motorola-powermax |
467 | exit 0 ;; | |
438 | exit ;; | |
468 | 439 | Motorola:*:4.3:PL8-*) |
469 | 440 | echo powerpc-harris-powermax |
470 | exit 0 ;; | |
441 | exit ;; | |
471 | 442 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) |
472 | 443 | echo powerpc-harris-powermax |
473 | exit 0 ;; | |
444 | exit ;; | |
474 | 445 | Night_Hawk:Power_UNIX:*:*) |
475 | 446 | echo powerpc-harris-powerunix |
476 | exit 0 ;; | |
447 | exit ;; | |
477 | 448 | m88k:CX/UX:7*:*) |
478 | 449 | echo m88k-harris-cxux7 |
479 | exit 0 ;; | |
450 | exit ;; | |
480 | 451 | m88k:*:4*:R4*) |
481 | 452 | echo m88k-motorola-sysv4 |
482 | exit 0 ;; | |
453 | exit ;; | |
483 | 454 | m88k:*:3*:R3*) |
484 | 455 | echo m88k-motorola-sysv3 |
485 | exit 0 ;; | |
456 | exit ;; | |
486 | 457 | AViiON:dgux:*:*) |
487 | 458 | # DG/UX returns AViiON for all architectures |
488 | 459 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
498 | 469 | else |
499 | 470 | echo i586-dg-dgux${UNAME_RELEASE} |
500 | 471 | fi |
501 | exit 0 ;; | |
472 | exit ;; | |
502 | 473 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
503 | 474 | echo m88k-dolphin-sysv3 |
504 | exit 0 ;; | |
475 | exit ;; | |
505 | 476 | M88*:*:R3*:*) |
506 | 477 | # Delta 88k system running SVR3 |
507 | 478 | echo m88k-motorola-sysv3 |
508 | exit 0 ;; | |
479 | exit ;; | |
509 | 480 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) |
510 | 481 | echo m88k-tektronix-sysv3 |
511 | exit 0 ;; | |
482 | exit ;; | |
512 | 483 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) |
513 | 484 | echo m68k-tektronix-bsd |
514 | exit 0 ;; | |
485 | exit ;; | |
515 | 486 | *:IRIX*:*:*) |
516 | 487 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` |
517 | exit 0 ;; | |
488 | exit ;; | |
518 | 489 | ????????: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 ' | |
521 | 492 | i*86:AIX:*:*) |
522 | 493 | echo i386-ibm-aix |
523 | exit 0 ;; | |
494 | exit ;; | |
524 | 495 | ia64:AIX:*:*) |
525 | 496 | if [ -x /usr/bin/oslevel ] ; then |
526 | 497 | IBM_REV=`/usr/bin/oslevel` |
528 | 499 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} |
529 | 500 | fi |
530 | 501 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} |
531 | exit 0 ;; | |
502 | exit ;; | |
532 | 503 | *:AIX:2:3) |
533 | 504 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then |
534 | 505 | eval $set_cc_for_build |
543 | 514 | exit(0); |
544 | 515 | } |
545 | 516 | 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 | |
548 | 523 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then |
549 | 524 | echo rs6000-ibm-aix3.2.4 |
550 | 525 | else |
551 | 526 | echo rs6000-ibm-aix3.2 |
552 | 527 | fi |
553 | exit 0 ;; | |
528 | exit ;; | |
554 | 529 | *:AIX:*:[45]) |
555 | 530 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` |
556 | 531 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then |
564 | 539 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} |
565 | 540 | fi |
566 | 541 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} |
567 | exit 0 ;; | |
542 | exit ;; | |
568 | 543 | *:AIX:*:*) |
569 | 544 | echo rs6000-ibm-aix |
570 | exit 0 ;; | |
545 | exit ;; | |
571 | 546 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) |
572 | 547 | echo romp-ibm-bsd4.4 |
573 | exit 0 ;; | |
548 | exit ;; | |
574 | 549 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and |
575 | 550 | 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 | |
577 | 552 | *:BOSX:*:*) |
578 | 553 | echo rs6000-bull-bosx |
579 | exit 0 ;; | |
554 | exit ;; | |
580 | 555 | DPX/2?00:B.O.S.:*:*) |
581 | 556 | echo m68k-bull-sysv3 |
582 | exit 0 ;; | |
557 | exit ;; | |
583 | 558 | 9000/[34]??:4.3bsd:1.*:*) |
584 | 559 | echo m68k-hp-bsd |
585 | exit 0 ;; | |
560 | exit ;; | |
586 | 561 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) |
587 | 562 | echo m68k-hp-bsd4.4 |
588 | exit 0 ;; | |
563 | exit ;; | |
589 | 564 | 9000/[34678]??:HP-UX:*:*) |
590 | 565 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` |
591 | 566 | case "${UNAME_MACHINE}" in |
647 | 622 | esac |
648 | 623 | if [ ${HP_ARCH} = "hppa2.0w" ] |
649 | 624 | 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 | |
653 | 638 | then |
654 | 639 | HP_ARCH="hppa2.0w" |
655 | 640 | else |
657 | 642 | fi |
658 | 643 | fi |
659 | 644 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
660 | exit 0 ;; | |
645 | exit ;; | |
661 | 646 | ia64:HP-UX:*:*) |
662 | 647 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` |
663 | 648 | echo ia64-hp-hpux${HPUX_REV} |
664 | exit 0 ;; | |
649 | exit ;; | |
665 | 650 | 3050*:HI-UX:*:*) |
666 | 651 | eval $set_cc_for_build |
667 | 652 | sed 's/^ //' << EOF >$dummy.c |
689 | 674 | exit (0); |
690 | 675 | } |
691 | 676 | 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; } | |
693 | 679 | echo unknown-hitachi-hiuxwe2 |
694 | exit 0 ;; | |
680 | exit ;; | |
695 | 681 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) |
696 | 682 | echo hppa1.1-hp-bsd |
697 | exit 0 ;; | |
683 | exit ;; | |
698 | 684 | 9000/8??:4.3bsd:*:*) |
699 | 685 | echo hppa1.0-hp-bsd |
700 | exit 0 ;; | |
686 | exit ;; | |
701 | 687 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) |
702 | 688 | echo hppa1.0-hp-mpeix |
703 | exit 0 ;; | |
689 | exit ;; | |
704 | 690 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) |
705 | 691 | echo hppa1.1-hp-osf |
706 | exit 0 ;; | |
692 | exit ;; | |
707 | 693 | hp8??:OSF1:*:*) |
708 | 694 | echo hppa1.0-hp-osf |
709 | exit 0 ;; | |
695 | exit ;; | |
710 | 696 | i*86:OSF1:*:*) |
711 | 697 | if [ -x /usr/sbin/sysversion ] ; then |
712 | 698 | echo ${UNAME_MACHINE}-unknown-osf1mk |
713 | 699 | else |
714 | 700 | echo ${UNAME_MACHINE}-unknown-osf1 |
715 | 701 | fi |
716 | exit 0 ;; | |
702 | exit ;; | |
717 | 703 | parisc*:Lites*:*:*) |
718 | 704 | echo hppa1.1-hp-lites |
719 | exit 0 ;; | |
705 | exit ;; | |
720 | 706 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) |
721 | 707 | echo c1-convex-bsd |
722 | exit 0 ;; | |
708 | exit ;; | |
723 | 709 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) |
724 | 710 | if getsysinfo -f scalar_acc |
725 | 711 | then echo c32-convex-bsd |
726 | 712 | else echo c2-convex-bsd |
727 | 713 | fi |
728 | exit 0 ;; | |
714 | exit ;; | |
729 | 715 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) |
730 | 716 | echo c34-convex-bsd |
731 | exit 0 ;; | |
717 | exit ;; | |
732 | 718 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) |
733 | 719 | echo c38-convex-bsd |
734 | exit 0 ;; | |
720 | exit ;; | |
735 | 721 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) |
736 | 722 | echo c4-convex-bsd |
737 | exit 0 ;; | |
723 | exit ;; | |
738 | 724 | CRAY*Y-MP:*:*:*) |
739 | 725 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
740 | exit 0 ;; | |
726 | exit ;; | |
741 | 727 | CRAY*[A-Z]90:*:*:*) |
742 | 728 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ |
743 | 729 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ |
744 | 730 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ |
745 | 731 | -e 's/\.[^.]*$/.X/' |
746 | exit 0 ;; | |
732 | exit ;; | |
747 | 733 | CRAY*TS:*:*:*) |
748 | 734 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
749 | exit 0 ;; | |
735 | exit ;; | |
750 | 736 | CRAY*T3E:*:*:*) |
751 | 737 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
752 | exit 0 ;; | |
738 | exit ;; | |
753 | 739 | CRAY*SV1:*:*:*) |
754 | 740 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
755 | exit 0 ;; | |
741 | exit ;; | |
756 | 742 | *:UNICOS/mp:*:*) |
757 | 743 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
758 | exit 0 ;; | |
744 | exit ;; | |
759 | 745 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
760 | 746 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
761 | 747 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
762 | 748 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` |
763 | 749 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
764 | exit 0 ;; | |
750 | exit ;; | |
765 | 751 | 5000:UNIX_System_V:4.*:*) |
766 | 752 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
767 | 753 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` |
768 | 754 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
769 | exit 0 ;; | |
755 | exit ;; | |
770 | 756 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
771 | 757 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} |
772 | exit 0 ;; | |
758 | exit ;; | |
773 | 759 | sparc*:BSD/OS:*:*) |
774 | 760 | echo sparc-unknown-bsdi${UNAME_RELEASE} |
775 | exit 0 ;; | |
761 | exit ;; | |
776 | 762 | *:BSD/OS:*:*) |
777 | 763 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
778 | exit 0 ;; | |
764 | exit ;; | |
779 | 765 | *:FreeBSD:*:*) |
780 | 766 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
781 | exit 0 ;; | |
767 | exit ;; | |
782 | 768 | i*:CYGWIN*:*) |
783 | 769 | echo ${UNAME_MACHINE}-pc-cygwin |
784 | exit 0 ;; | |
770 | exit ;; | |
785 | 771 | i*:MINGW*:*) |
786 | 772 | 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 ;; | |
788 | 778 | i*:PW*:*) |
789 | 779 | echo ${UNAME_MACHINE}-pc-pw32 |
790 | exit 0 ;; | |
780 | exit ;; | |
791 | 781 | x86:Interix*:[34]*) |
792 | 782 | echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' |
793 | exit 0 ;; | |
783 | exit ;; | |
794 | 784 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
795 | 785 | echo i${UNAME_MACHINE}-pc-mks |
796 | exit 0 ;; | |
786 | exit ;; | |
797 | 787 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
798 | 788 | # How do we know it's Interix rather than the generic POSIX subsystem? |
799 | 789 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
800 | 790 | # UNAME_MACHINE based on the output of uname instead of i386? |
801 | 791 | echo i586-pc-interix |
802 | exit 0 ;; | |
792 | exit ;; | |
803 | 793 | i*:UWIN*:*) |
804 | 794 | echo ${UNAME_MACHINE}-pc-uwin |
805 | exit 0 ;; | |
806 | amd64:CYGWIN*:*:*) | |
795 | exit ;; | |
796 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) | |
807 | 797 | echo x86_64-unknown-cygwin |
808 | exit 0 ;; | |
798 | exit ;; | |
809 | 799 | p*:CYGWIN*:*) |
810 | 800 | echo powerpcle-unknown-cygwin |
811 | exit 0 ;; | |
801 | exit ;; | |
812 | 802 | prep*:SunOS:5.*:*) |
813 | 803 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
814 | exit 0 ;; | |
804 | exit ;; | |
815 | 805 | *:GNU:*:*) |
816 | 806 | # the GNU system |
817 | 807 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` |
818 | exit 0 ;; | |
808 | exit ;; | |
819 | 809 | *:GNU/*:*:*) |
820 | 810 | # other systems with GNU libc and userland |
821 | 811 | 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 ;; | |
823 | 813 | i*86:Minix:*:*) |
824 | 814 | echo ${UNAME_MACHINE}-pc-minix |
825 | exit 0 ;; | |
815 | exit ;; | |
826 | 816 | arm*:Linux:*:*) |
827 | 817 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
828 | exit 0 ;; | |
818 | exit ;; | |
829 | 819 | cris:Linux:*:*) |
830 | 820 | echo cris-axis-linux-gnu |
831 | exit 0 ;; | |
821 | exit ;; | |
832 | 822 | crisv32:Linux:*:*) |
833 | 823 | echo crisv32-axis-linux-gnu |
834 | exit 0 ;; | |
824 | exit ;; | |
835 | 825 | frv:Linux:*:*) |
836 | 826 | echo frv-unknown-linux-gnu |
837 | exit 0 ;; | |
827 | exit ;; | |
838 | 828 | ia64:Linux:*:*) |
839 | 829 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
840 | exit 0 ;; | |
830 | exit ;; | |
841 | 831 | m32r*:Linux:*:*) |
842 | 832 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
843 | exit 0 ;; | |
833 | exit ;; | |
844 | 834 | m68*:Linux:*:*) |
845 | 835 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
846 | exit 0 ;; | |
836 | exit ;; | |
847 | 837 | mips:Linux:*:*) |
848 | 838 | eval $set_cc_for_build |
849 | 839 | sed 's/^ //' << EOF >$dummy.c |
861 | 851 | #endif |
862 | 852 | EOF |
863 | 853 | 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; } | |
865 | 855 | ;; |
866 | 856 | mips64:Linux:*:*) |
867 | 857 | eval $set_cc_for_build |
880 | 870 | #endif |
881 | 871 | EOF |
882 | 872 | 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; } | |
884 | 874 | ;; |
875 | or32:Linux:*:*) | |
876 | echo or32-unknown-linux-gnu | |
877 | exit ;; | |
885 | 878 | ppc:Linux:*:*) |
886 | 879 | echo powerpc-unknown-linux-gnu |
887 | exit 0 ;; | |
880 | exit ;; | |
888 | 881 | ppc64:Linux:*:*) |
889 | 882 | echo powerpc64-unknown-linux-gnu |
890 | exit 0 ;; | |
883 | exit ;; | |
891 | 884 | alpha:Linux:*:*) |
892 | 885 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
893 | 886 | EV5) UNAME_MACHINE=alphaev5 ;; |
901 | 894 | objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null |
902 | 895 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
903 | 896 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
904 | exit 0 ;; | |
897 | exit ;; | |
905 | 898 | parisc:Linux:*:* | hppa:Linux:*:*) |
906 | 899 | # Look for CPU level |
907 | 900 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
909 | 902 | PA8*) echo hppa2.0-unknown-linux-gnu ;; |
910 | 903 | *) echo hppa-unknown-linux-gnu ;; |
911 | 904 | esac |
912 | exit 0 ;; | |
905 | exit ;; | |
913 | 906 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
914 | 907 | echo hppa64-unknown-linux-gnu |
915 | exit 0 ;; | |
908 | exit ;; | |
916 | 909 | s390:Linux:*:* | s390x:Linux:*:*) |
917 | 910 | echo ${UNAME_MACHINE}-ibm-linux |
918 | exit 0 ;; | |
911 | exit ;; | |
919 | 912 | sh64*:Linux:*:*) |
920 | 913 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
921 | exit 0 ;; | |
914 | exit ;; | |
922 | 915 | sh*:Linux:*:*) |
923 | 916 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
924 | exit 0 ;; | |
917 | exit ;; | |
925 | 918 | sparc:Linux:*:* | sparc64:Linux:*:*) |
926 | 919 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
927 | exit 0 ;; | |
920 | exit ;; | |
928 | 921 | x86_64:Linux:*:*) |
929 | 922 | echo x86_64-unknown-linux-gnu |
930 | exit 0 ;; | |
923 | exit ;; | |
931 | 924 | i*86:Linux:*:*) |
932 | 925 | # The BFD linker knows what the default object file format is, so |
933 | 926 | # first see if it will tell us. cd to the root directory to prevent |
945 | 938 | ;; |
946 | 939 | a.out-i386-linux) |
947 | 940 | echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
948 | exit 0 ;; | |
941 | exit ;; | |
949 | 942 | coff-i386) |
950 | 943 | echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
951 | exit 0 ;; | |
944 | exit ;; | |
952 | 945 | "") |
953 | 946 | # Either a pre-BFD a.out linker (linux-gnuoldld) or |
954 | 947 | # one that does not give us useful --help. |
955 | 948 | echo "${UNAME_MACHINE}-pc-linux-gnuoldld" |
956 | exit 0 ;; | |
949 | exit ;; | |
957 | 950 | esac |
958 | 951 | # Determine whether the default compiler is a.out or elf |
959 | 952 | eval $set_cc_for_build |
981 | 974 | #endif |
982 | 975 | EOF |
983 | 976 | 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; } | |
986 | 982 | ;; |
987 | 983 | i*86:DYNIX/ptx:4*:*) |
988 | 984 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
989 | 985 | # earlier versions are messed up and put the nodename in both |
990 | 986 | # sysname and nodename. |
991 | 987 | echo i386-sequent-sysv4 |
992 | exit 0 ;; | |
988 | exit ;; | |
993 | 989 | i*86:UNIX_SV:4.2MP:2.*) |
994 | 990 | # Unixware is an offshoot of SVR4, but it has its own version |
995 | 991 | # number series starting with 2... |
997 | 993 | # I just have to hope. -- rms. |
998 | 994 | # Use sysv4.2uw... so that sysv4* matches it. |
999 | 995 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
1000 | exit 0 ;; | |
996 | exit ;; | |
1001 | 997 | i*86:OS/2:*:*) |
1002 | 998 | # If we were able to find `uname', then EMX Unix compatibility |
1003 | 999 | # is probably installed. |
1004 | 1000 | echo ${UNAME_MACHINE}-pc-os2-emx |
1005 | exit 0 ;; | |
1001 | exit ;; | |
1006 | 1002 | i*86:XTS-300:*:STOP) |
1007 | 1003 | echo ${UNAME_MACHINE}-unknown-stop |
1008 | exit 0 ;; | |
1004 | exit ;; | |
1009 | 1005 | i*86:atheos:*:*) |
1010 | 1006 | echo ${UNAME_MACHINE}-unknown-atheos |
1011 | exit 0 ;; | |
1012 | i*86:syllable:*:*) | |
1007 | exit ;; | |
1008 | i*86:syllable:*:*) | |
1013 | 1009 | echo ${UNAME_MACHINE}-pc-syllable |
1014 | exit 0 ;; | |
1010 | exit ;; | |
1015 | 1011 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) |
1016 | 1012 | echo i386-unknown-lynxos${UNAME_RELEASE} |
1017 | exit 0 ;; | |
1013 | exit ;; | |
1018 | 1014 | i*86:*DOS:*:*) |
1019 | 1015 | echo ${UNAME_MACHINE}-pc-msdosdjgpp |
1020 | exit 0 ;; | |
1016 | exit ;; | |
1021 | 1017 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) |
1022 | 1018 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` |
1023 | 1019 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then |
1025 | 1021 | else |
1026 | 1022 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
1027 | 1023 | fi |
1028 | exit 0 ;; | |
1029 | i*86:*:5:[78]*) | |
1024 | exit ;; | |
1025 | i*86:*:5:[678]*) | |
1026 | # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
1030 | 1027 | case `/bin/uname -X | grep "^Machine"` in |
1031 | 1028 | *486*) UNAME_MACHINE=i486 ;; |
1032 | 1029 | *Pentium) UNAME_MACHINE=i586 ;; |
1033 | 1030 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
1034 | 1031 | esac |
1035 | 1032 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} |
1036 | exit 0 ;; | |
1033 | exit ;; | |
1037 | 1034 | i*86:*:3.2:*) |
1038 | 1035 | if test -f /usr/options/cb.name; then |
1039 | 1036 | UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
1051 | 1048 | else |
1052 | 1049 | echo ${UNAME_MACHINE}-pc-sysv32 |
1053 | 1050 | fi |
1054 | exit 0 ;; | |
1051 | exit ;; | |
1055 | 1052 | pc:*:*:*) |
1056 | 1053 | # Left here for compatibility: |
1057 | 1054 | # uname -m prints for DJGPP always 'pc', but it prints nothing about |
1058 | 1055 | # the processor, so we play safe by assuming i386. |
1059 | 1056 | echo i386-pc-msdosdjgpp |
1060 | exit 0 ;; | |
1057 | exit ;; | |
1061 | 1058 | Intel:Mach:3*:*) |
1062 | 1059 | echo i386-pc-mach3 |
1063 | exit 0 ;; | |
1060 | exit ;; | |
1064 | 1061 | paragon:*:*:*) |
1065 | 1062 | echo i860-intel-osf1 |
1066 | exit 0 ;; | |
1063 | exit ;; | |
1067 | 1064 | i860:*:4.*:*) # i860-SVR4 |
1068 | 1065 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then |
1069 | 1066 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 |
1070 | 1067 | else # Add other i860-SVR4 vendors below as they are discovered. |
1071 | 1068 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 |
1072 | 1069 | fi |
1073 | exit 0 ;; | |
1070 | exit ;; | |
1074 | 1071 | mini*:CTIX:SYS*5:*) |
1075 | 1072 | # "miniframe" |
1076 | 1073 | echo m68010-convergent-sysv |
1077 | exit 0 ;; | |
1074 | exit ;; | |
1078 | 1075 | mc68k:UNIX:SYSTEM5:3.51m) |
1079 | 1076 | echo m68k-convergent-sysv |
1080 | exit 0 ;; | |
1077 | exit ;; | |
1081 | 1078 | M680?0:D-NIX:5.3:*) |
1082 | 1079 | echo m68k-diab-dnix |
1083 | exit 0 ;; | |
1080 | exit ;; | |
1084 | 1081 | M68*:*:R3V[5678]*:*) |
1085 | test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; | |
1082 | test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; | |
1086 | 1083 | 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) |
1087 | 1084 | OS_REL='' |
1088 | 1085 | test -r /etc/.relid \ |
1089 | 1086 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
1090 | 1087 | /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; } | |
1092 | 1089 | /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; } ;; | |
1094 | 1091 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) |
1095 | 1092 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
1096 | && echo i486-ncr-sysv4 && exit 0 ;; | |
1093 | && { echo i486-ncr-sysv4; exit; } ;; | |
1097 | 1094 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) |
1098 | 1095 | echo m68k-unknown-lynxos${UNAME_RELEASE} |
1099 | exit 0 ;; | |
1096 | exit ;; | |
1100 | 1097 | mc68030:UNIX_System_V:4.*:*) |
1101 | 1098 | echo m68k-atari-sysv4 |
1102 | exit 0 ;; | |
1099 | exit ;; | |
1103 | 1100 | TSUNAMI:LynxOS:2.*:*) |
1104 | 1101 | echo sparc-unknown-lynxos${UNAME_RELEASE} |
1105 | exit 0 ;; | |
1102 | exit ;; | |
1106 | 1103 | rs6000:LynxOS:2.*:*) |
1107 | 1104 | echo rs6000-unknown-lynxos${UNAME_RELEASE} |
1108 | exit 0 ;; | |
1105 | exit ;; | |
1109 | 1106 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) |
1110 | 1107 | echo powerpc-unknown-lynxos${UNAME_RELEASE} |
1111 | exit 0 ;; | |
1108 | exit ;; | |
1112 | 1109 | SM[BE]S:UNIX_SV:*:*) |
1113 | 1110 | echo mips-dde-sysv${UNAME_RELEASE} |
1114 | exit 0 ;; | |
1111 | exit ;; | |
1115 | 1112 | RM*:ReliantUNIX-*:*:*) |
1116 | 1113 | echo mips-sni-sysv4 |
1117 | exit 0 ;; | |
1114 | exit ;; | |
1118 | 1115 | RM*:SINIX-*:*:*) |
1119 | 1116 | echo mips-sni-sysv4 |
1120 | exit 0 ;; | |
1117 | exit ;; | |
1121 | 1118 | *:SINIX-*:*:*) |
1122 | 1119 | if uname -p 2>/dev/null >/dev/null ; then |
1123 | 1120 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
1125 | 1122 | else |
1126 | 1123 | echo ns32k-sni-sysv |
1127 | 1124 | fi |
1128 | exit 0 ;; | |
1125 | exit ;; | |
1129 | 1126 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort |
1130 | 1127 | # says <Richard.M.Bartel@ccMail.Census.GOV> |
1131 | 1128 | echo i586-unisys-sysv4 |
1132 | exit 0 ;; | |
1129 | exit ;; | |
1133 | 1130 | *:UNIX_System_V:4*:FTX*) |
1134 | 1131 | # From Gerald Hewes <hewes@openmarket.com>. |
1135 | 1132 | # How about differentiating between stratus architectures? -djm |
1136 | 1133 | echo hppa1.1-stratus-sysv4 |
1137 | exit 0 ;; | |
1134 | exit ;; | |
1138 | 1135 | *:*:*:FTX*) |
1139 | 1136 | # From seanf@swdc.stratus.com. |
1140 | 1137 | echo i860-stratus-sysv4 |
1141 | exit 0 ;; | |
1138 | exit ;; | |
1142 | 1139 | i*86:VOS:*:*) |
1143 | 1140 | # From Paul.Green@stratus.com. |
1144 | 1141 | echo ${UNAME_MACHINE}-stratus-vos |
1145 | exit 0 ;; | |
1142 | exit ;; | |
1146 | 1143 | *:VOS:*:*) |
1147 | 1144 | # From Paul.Green@stratus.com. |
1148 | 1145 | echo hppa1.1-stratus-vos |
1149 | exit 0 ;; | |
1146 | exit ;; | |
1150 | 1147 | mc68*:A/UX:*:*) |
1151 | 1148 | echo m68k-apple-aux${UNAME_RELEASE} |
1152 | exit 0 ;; | |
1149 | exit ;; | |
1153 | 1150 | news*:NEWS-OS:6*:*) |
1154 | 1151 | echo mips-sony-newsos6 |
1155 | exit 0 ;; | |
1152 | exit ;; | |
1156 | 1153 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
1157 | 1154 | if [ -d /usr/nec ]; then |
1158 | 1155 | echo mips-nec-sysv${UNAME_RELEASE} |
1159 | 1156 | else |
1160 | 1157 | echo mips-unknown-sysv${UNAME_RELEASE} |
1161 | 1158 | fi |
1162 | exit 0 ;; | |
1159 | exit ;; | |
1163 | 1160 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
1164 | 1161 | echo powerpc-be-beos |
1165 | exit 0 ;; | |
1162 | exit ;; | |
1166 | 1163 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. |
1167 | 1164 | echo powerpc-apple-beos |
1168 | exit 0 ;; | |
1165 | exit ;; | |
1169 | 1166 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. |
1170 | 1167 | echo i586-pc-beos |
1171 | exit 0 ;; | |
1168 | exit ;; | |
1172 | 1169 | SX-4:SUPER-UX:*:*) |
1173 | 1170 | echo sx4-nec-superux${UNAME_RELEASE} |
1174 | exit 0 ;; | |
1171 | exit ;; | |
1175 | 1172 | SX-5:SUPER-UX:*:*) |
1176 | 1173 | echo sx5-nec-superux${UNAME_RELEASE} |
1177 | exit 0 ;; | |
1174 | exit ;; | |
1178 | 1175 | SX-6:SUPER-UX:*:*) |
1179 | 1176 | echo sx6-nec-superux${UNAME_RELEASE} |
1180 | exit 0 ;; | |
1177 | exit ;; | |
1181 | 1178 | Power*:Rhapsody:*:*) |
1182 | 1179 | echo powerpc-apple-rhapsody${UNAME_RELEASE} |
1183 | exit 0 ;; | |
1180 | exit ;; | |
1184 | 1181 | *:Rhapsody:*:*) |
1185 | 1182 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
1186 | exit 0 ;; | |
1183 | exit ;; | |
1187 | 1184 | *:Darwin:*:*) |
1188 | 1185 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
1189 | 1186 | case $UNAME_PROCESSOR in |
1191 | 1188 | unknown) UNAME_PROCESSOR=powerpc ;; |
1192 | 1189 | esac |
1193 | 1190 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
1194 | exit 0 ;; | |
1191 | exit ;; | |
1195 | 1192 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1196 | 1193 | UNAME_PROCESSOR=`uname -p` |
1197 | 1194 | if test "$UNAME_PROCESSOR" = "x86"; then |
1199 | 1196 | UNAME_MACHINE=pc |
1200 | 1197 | fi |
1201 | 1198 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} |
1202 | exit 0 ;; | |
1199 | exit ;; | |
1203 | 1200 | *:QNX:*:4*) |
1204 | 1201 | echo i386-pc-qnx |
1205 | exit 0 ;; | |
1202 | exit ;; | |
1206 | 1203 | NSE-?:NONSTOP_KERNEL:*:*) |
1207 | 1204 | echo nse-tandem-nsk${UNAME_RELEASE} |
1208 | exit 0 ;; | |
1205 | exit ;; | |
1209 | 1206 | NSR-?:NONSTOP_KERNEL:*:*) |
1210 | 1207 | echo nsr-tandem-nsk${UNAME_RELEASE} |
1211 | exit 0 ;; | |
1208 | exit ;; | |
1212 | 1209 | *:NonStop-UX:*:*) |
1213 | 1210 | echo mips-compaq-nonstopux |
1214 | exit 0 ;; | |
1211 | exit ;; | |
1215 | 1212 | BS2000:POSIX*:*:*) |
1216 | 1213 | echo bs2000-siemens-sysv |
1217 | exit 0 ;; | |
1214 | exit ;; | |
1218 | 1215 | DS/*:UNIX_System_V:*:*) |
1219 | 1216 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} |
1220 | exit 0 ;; | |
1217 | exit ;; | |
1221 | 1218 | *:Plan9:*:*) |
1222 | 1219 | # "uname -m" is not consistent, so use $cputype instead. 386 |
1223 | 1220 | # is converted to i386 for consistency with other x86 |
1228 | 1225 | UNAME_MACHINE="$cputype" |
1229 | 1226 | fi |
1230 | 1227 | echo ${UNAME_MACHINE}-unknown-plan9 |
1231 | exit 0 ;; | |
1228 | exit ;; | |
1232 | 1229 | *:TOPS-10:*:*) |
1233 | 1230 | echo pdp10-unknown-tops10 |
1234 | exit 0 ;; | |
1231 | exit ;; | |
1235 | 1232 | *:TENEX:*:*) |
1236 | 1233 | echo pdp10-unknown-tenex |
1237 | exit 0 ;; | |
1234 | exit ;; | |
1238 | 1235 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) |
1239 | 1236 | echo pdp10-dec-tops20 |
1240 | exit 0 ;; | |
1237 | exit ;; | |
1241 | 1238 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) |
1242 | 1239 | echo pdp10-xkl-tops20 |
1243 | exit 0 ;; | |
1240 | exit ;; | |
1244 | 1241 | *:TOPS-20:*:*) |
1245 | 1242 | echo pdp10-unknown-tops20 |
1246 | exit 0 ;; | |
1243 | exit ;; | |
1247 | 1244 | *:ITS:*:*) |
1248 | 1245 | echo pdp10-unknown-its |
1249 | exit 0 ;; | |
1246 | exit ;; | |
1250 | 1247 | SEI:*:*:SEIUX) |
1251 | 1248 | echo mips-sei-seiux${UNAME_RELEASE} |
1252 | exit 0 ;; | |
1249 | exit ;; | |
1253 | 1250 | *:DragonFly:*:*) |
1254 | 1251 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
1255 | exit 0 ;; | |
1252 | exit ;; | |
1256 | 1253 | *:*VMS:*:*) |
1257 | 1254 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
1258 | 1255 | 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 ;; | |
1262 | 1259 | esac ;; |
1263 | 1260 | *:XENIX:*:SysV) |
1264 | 1261 | 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 ;; | |
1266 | 1266 | esac |
1267 | 1267 | |
1268 | 1268 | #echo '(No uname command or uname output not recognized.)' 1>&2 |
1294 | 1294 | #endif |
1295 | 1295 | |
1296 | 1296 | #if defined (__arm) && defined (__acorn) && defined (__unix) |
1297 | printf ("arm-acorn-riscix"); exit (0); | |
1297 | printf ("arm-acorn-riscix\n"); exit (0); | |
1298 | 1298 | #endif |
1299 | 1299 | |
1300 | 1300 | #if defined (hp300) && !defined (hpux) |
1383 | 1383 | } |
1384 | 1384 | EOF |
1385 | 1385 | |
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; } | |
1387 | 1388 | |
1388 | 1389 | # Apollos put the system type in the environment. |
1389 | 1390 | |
1390 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } | |
1391 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } | |
1391 | 1392 | |
1392 | 1393 | # Convex versions that predate uname can use getsysinfo(1) |
1393 | 1394 | |
1396 | 1397 | case `getsysinfo -f cpu_type` in |
1397 | 1398 | c1*) |
1398 | 1399 | echo c1-convex-bsd |
1399 | exit 0 ;; | |
1400 | exit ;; | |
1400 | 1401 | c2*) |
1401 | 1402 | if getsysinfo -f scalar_acc |
1402 | 1403 | then echo c32-convex-bsd |
1403 | 1404 | else echo c2-convex-bsd |
1404 | 1405 | fi |
1405 | exit 0 ;; | |
1406 | exit ;; | |
1406 | 1407 | c34*) |
1407 | 1408 | echo c34-convex-bsd |
1408 | exit 0 ;; | |
1409 | exit ;; | |
1409 | 1410 | c38*) |
1410 | 1411 | echo c38-convex-bsd |
1411 | exit 0 ;; | |
1412 | exit ;; | |
1412 | 1413 | c4*) |
1413 | 1414 | echo c4-convex-bsd |
1414 | exit 0 ;; | |
1415 | exit ;; | |
1415 | 1416 | esac |
1416 | 1417 | fi |
1417 | 1418 |
2 | 2 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 | 3 | # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
4 | 4 | |
5 | timestamp='2005-04-22' | |
5 | timestamp='2005-07-08' | |
6 | 6 | |
7 | 7 | # This file is (in principle) common to ALL GNU software. |
8 | 8 | # The presence of a machine in this file suggests that SOME GNU software |
20 | 20 | # |
21 | 21 | # You should have received a copy of the GNU General Public License |
22 | 22 | # 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 | # | |
26 | 26 | # As a special exception to the GNU General Public License, if you |
27 | 27 | # distribute this file as part of a program that contains a |
28 | 28 | # configuration script generated by Autoconf, you may include it under |
29 | 29 | # the same distribution terms that you use for the rest of that program. |
30 | ||
30 | 31 | |
31 | 32 | # Please send patches to <config-patches@gnu.org>. Submit a context |
32 | 33 | # diff and a properly formatted ChangeLog entry. |
82 | 83 | while test $# -gt 0 ; do |
83 | 84 | case $1 in |
84 | 85 | --time-stamp | --time* | -t ) |
85 | echo "$timestamp" ; exit 0 ;; | |
86 | echo "$timestamp" ; exit ;; | |
86 | 87 | --version | -v ) |
87 | echo "$version" ; exit 0 ;; | |
88 | echo "$version" ; exit ;; | |
88 | 89 | --help | --h* | -h ) |
89 | echo "$usage"; exit 0 ;; | |
90 | echo "$usage"; exit ;; | |
90 | 91 | -- ) # Stop option processing |
91 | 92 | shift; break ;; |
92 | 93 | - ) # Use stdin as input. |
98 | 99 | *local*) |
99 | 100 | # First pass through any local machine types. |
100 | 101 | echo $1 |
101 | exit 0;; | |
102 | exit ;; | |
102 | 103 | |
103 | 104 | * ) |
104 | 105 | break ;; |
246 | 247 | | mips64vr4100 | mips64vr4100el \ |
247 | 248 | | mips64vr4300 | mips64vr4300el \ |
248 | 249 | | mips64vr5000 | mips64vr5000el \ |
250 | | mips64vr5900 | mips64vr5900el \ | |
249 | 251 | | mipsisa32 | mipsisa32el \ |
250 | 252 | | mipsisa32r2 | mipsisa32r2el \ |
251 | 253 | | mipsisa64 | mipsisa64el \ |
254 | 256 | | mipsisa64sr71k | mipsisa64sr71kel \ |
255 | 257 | | mipstx39 | mipstx39el \ |
256 | 258 | | mn10200 | mn10300 \ |
259 | | ms1 \ | |
257 | 260 | | msp430 \ |
258 | 261 | | ns16k | ns32k \ |
259 | | openrisc | or32 \ | |
262 | | or32 \ | |
260 | 263 | | pdp10 | pdp11 | pj | pjl \ |
261 | 264 | | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ |
262 | 265 | | 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 \ | |
264 | 267 | | sh64 | sh64le \ |
265 | 268 | | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ |
266 | 269 | | sparcv8 | sparcv9 | sparcv9b \ |
270 | 273 | | we32k \ |
271 | 274 | | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ |
272 | 275 | | z8k) |
276 | basic_machine=$basic_machine-unknown | |
277 | ;; | |
278 | m32c) | |
273 | 279 | basic_machine=$basic_machine-unknown |
274 | 280 | ;; |
275 | 281 | m6811 | m68hc11 | m6812 | m68hc12) |
320 | 326 | | mips64vr4100-* | mips64vr4100el-* \ |
321 | 327 | | mips64vr4300-* | mips64vr4300el-* \ |
322 | 328 | | mips64vr5000-* | mips64vr5000el-* \ |
329 | | mips64vr5900-* | mips64vr5900el-* \ | |
323 | 330 | | mipsisa32-* | mipsisa32el-* \ |
324 | 331 | | mipsisa32r2-* | mipsisa32r2el-* \ |
325 | 332 | | mipsisa64-* | mipsisa64el-* \ |
328 | 335 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ |
329 | 336 | | mipstx39-* | mipstx39el-* \ |
330 | 337 | | mmix-* \ |
338 | | ms1-* \ | |
331 | 339 | | msp430-* \ |
332 | 340 | | none-* | np1-* | ns16k-* | ns32k-* \ |
333 | 341 | | orion-* \ |
335 | 343 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ |
336 | 344 | | pyramid-* \ |
337 | 345 | | 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-* \ | |
339 | 347 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ |
340 | 348 | | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ |
341 | 349 | | sparclite-* \ |
350 | 358 | | ymp-* \ |
351 | 359 | | z8k-*) |
352 | 360 | ;; |
361 | m32c-*) | |
362 | ;; | |
353 | 363 | # Recognize the various machine names and aliases which stand |
354 | 364 | # for a CPU type and a company and sometimes even an OS. |
355 | 365 | 386bsd) |
760 | 770 | basic_machine=hppa1.1-oki |
761 | 771 | os=-proelf |
762 | 772 | ;; |
763 | or32 | or32-*) | |
773 | openrisc | openrisc-*) | |
764 | 774 | basic_machine=or32-unknown |
765 | os=-coff | |
766 | 775 | ;; |
767 | 776 | os400) |
768 | 777 | basic_machine=powerpc-ibm |
1088 | 1097 | we32k) |
1089 | 1098 | basic_machine=we32k-att |
1090 | 1099 | ;; |
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) | |
1092 | 1101 | basic_machine=sh-unknown |
1093 | ;; | |
1094 | sh64) | |
1095 | basic_machine=sh64-unknown | |
1096 | 1102 | ;; |
1097 | 1103 | sparc | sparcv8 | sparcv9 | sparcv9b) |
1098 | 1104 | basic_machine=sparc-sun |
1180 | 1186 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
1181 | 1187 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
1182 | 1188 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
1183 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) | |
1189 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | |
1190 | | -skyos* | -haiku*) | |
1184 | 1191 | # Remember, each alternative MUST END IN *, to match a version number. |
1185 | 1192 | ;; |
1186 | 1193 | -qnx*) |
1198 | 1205 | os=`echo $os | sed -e 's|nto|nto-qnx|'` |
1199 | 1206 | ;; |
1200 | 1207 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ |
1201 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | |
1208 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | |
1202 | 1209 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) |
1203 | 1210 | ;; |
1204 | 1211 | -mac*) |
1386 | 1393 | ;; |
1387 | 1394 | *-be) |
1388 | 1395 | os=-beos |
1396 | ;; | |
1397 | *-haiku) | |
1398 | os=-haiku | |
1389 | 1399 | ;; |
1390 | 1400 | *-ibm) |
1391 | 1401 | os=-aix |
1558 | 1568 | esac |
1559 | 1569 | |
1560 | 1570 | echo $basic_machine$os |
1561 | exit 0 | |
1571 | exit | |
1562 | 1572 | |
1563 | 1573 | # Local variables: |
1564 | 1574 | # eval: (add-hook 'write-file-hooks 'time-stamp) |
1497 | 1497 | |
1498 | 1498 | |
1499 | 1499 | VERSION_MAJOR=0 |
1500 | VERSION_MINOR=38 | |
1501 | ||
1502 | API_CURRENT=3 | |
1500 | VERSION_MINOR=39 | |
1501 | ||
1502 | API_CURRENT=4 | |
1503 | 1503 | API_REVISION=0 |
1504 | 1504 | API_COMPATIBILITY=3 |
1505 | 1505 |
0 | 0 | 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 $ | |
2 | 2 | |
3 | 3 | AC_INIT(src/main/libetpan_version.h.in) |
4 | 4 | |
5 | 5 | dnl Version major and minor |
6 | 6 | VERSION_MAJOR=0 |
7 | VERSION_MINOR=38 | |
7 | VERSION_MINOR=39 | |
8 | 8 | |
9 | 9 | dnl API version |
10 | 10 | dnl 1. If you have changed any of the sources for this library, the revision |
20 | 20 | dnl interface, then you have broken backward compatibility and age must be |
21 | 21 | dnl reset to `0'. This release has a new, but backwards incompatible |
22 | 22 | dnl interface. |
23 | API_CURRENT=3 | |
23 | API_CURRENT=4 | |
24 | 24 | API_REVISION=0 |
25 | 25 | API_COMPATIBILITY=3 |
26 | 26 |
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 | ||
0 | 8 | libetpan (0.38-2) unstable; urgency=low |
1 | 9 | |
2 | 10 | * Changed dependency from libgnutls11-dev to libgnutls-dev, per announced |
2 | 2 | Priority: optional |
3 | 3 | Maintainer: Nikita V. Youshchenko <yoush@cs.msu.su> |
4 | 4 | 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 | |
6 | 6 | |
7 | 7 | Package: libetpan-dev |
8 | 8 | Section: libdevel |
68 | 68 | dh_strip -a |
69 | 69 | dh_compress -a |
70 | 70 | dh_fixperms -a |
71 | dh_makeshlibs -plibetpan3 -V"libetpan3 (>= 0.38-1)" | |
71 | dh_makeshlibs -plibetpan3 -V"libetpan3 (>= 0.39.1-1)" | |
72 | 72 | dh_installdeb -a |
73 | 73 | dh_shlibdeps -a |
74 | 74 | dh_gencontrol -a |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailstream.h" |
393 | 393 | return s->read_buffer_len; |
394 | 394 | } |
395 | 395 | |
396 | #ifdef _MSC_VER | |
396 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
397 | 397 | struct timeval mailstream_network_delay = |
398 | 398 | { DEFAULT_NETWORK_TIMEOUT, 0 }; |
399 | 399 | #else |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailstream_socket.h" |
70 | 70 | static int mailstream_low_socket_get_fd(mailstream_low * s); |
71 | 71 | |
72 | 72 | static mailstream_low_driver local_mailstream_socket_driver = { |
73 | #ifdef _MSC_VER | |
73 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
74 | 74 | /* SEB */ |
75 | 75 | mailstream_low_socket_read, |
76 | 76 | mailstream_low_socket_write, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | /* |
99 | 99 | static void mailstream_low_ssl_free(mailstream_low * s); |
100 | 100 | static int mailstream_low_ssl_get_fd(mailstream_low * s); |
101 | 101 | |
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 | |
102 | 110 | static mailstream_low_driver local_mailstream_ssl_driver = { |
103 | 111 | mailstream_read: mailstream_low_ssl_read, |
104 | 112 | mailstream_write: mailstream_low_ssl_write, |
105 | 113 | mailstream_close: mailstream_low_ssl_close, |
106 | 114 | mailstream_free: mailstream_low_ssl_free, |
107 | 115 | mailstream_get_fd: mailstream_low_ssl_get_fd, |
116 | #endif | |
108 | 117 | }; |
109 | 118 | |
110 | 119 | mailstream_low_driver * mailstream_ssl_driver = &local_mailstream_ssl_driver; |
143 | 152 | |
144 | 153 | if (SSL_set_fd(ssl_conn, fd) == 0) |
145 | 154 | goto free_ssl_conn; |
146 | ||
147 | #ifndef USE_GNUTLS | |
148 | SSL_set_read_ahead(ssl_conn, 1); | |
149 | #endif | |
150 | 155 | |
151 | 156 | r = SSL_connect(ssl_conn); |
152 | 157 | if (r <= 0) |
262 | 267 | int ssl_r; |
263 | 268 | fd_set fds_read; |
264 | 269 | 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 | |
285 | 270 | |
286 | 271 | r = SSL_read(ssl_data->ssl_conn, buf, count); |
287 | 272 | if (r > 0) |
288 | 273 | return r; |
289 | 274 | |
290 | #ifdef USE_GNUTLS | |
291 | if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) | |
292 | return r; | |
293 | #else | |
294 | 275 | ssl_r = SSL_get_error(ssl_data->ssl_conn, r); |
295 | 276 | switch (ssl_r) { |
296 | 277 | case SSL_ERROR_NONE: |
312 | 293 | default: |
313 | 294 | return r; |
314 | 295 | } |
315 | #endif | |
316 | 296 | } |
317 | 297 | } |
318 | 298 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef __MMAP_STRING_H__ |
37 | 37 | #define __MMAP_STRING_H__ |
38 | 38 | |
39 | 39 | #include <sys/types.h> |
40 | ||
41 | #ifndef LIBETPAN_CONFIG_H | |
42 | # include "libetpan-config.h" | |
43 | #endif | |
40 | 44 | |
41 | 45 | #ifdef __cplusplus |
42 | 46 | extern "C" { |
66 | 70 | |
67 | 71 | /* Strings |
68 | 72 | */ |
69 | ||
73 | LIBETPAN_EXPORT | |
70 | 74 | MMAPString * mmap_string_new (const char * init); |
71 | 75 | |
76 | LIBETPAN_EXPORT | |
72 | 77 | MMAPString * mmap_string_new_len (const char * init, |
73 | 78 | size_t len); |
74 | 79 | |
80 | LIBETPAN_EXPORT | |
75 | 81 | MMAPString * mmap_string_sized_new (size_t dfl_size); |
76 | 82 | |
83 | LIBETPAN_EXPORT | |
77 | 84 | void mmap_string_free (MMAPString * string); |
78 | 85 | |
86 | LIBETPAN_EXPORT | |
79 | 87 | MMAPString * mmap_string_assign (MMAPString * string, |
80 | 88 | const char * rval); |
81 | 89 | |
90 | LIBETPAN_EXPORT | |
82 | 91 | MMAPString * mmap_string_truncate (MMAPString *string, |
83 | 92 | size_t len); |
84 | 93 | |
94 | LIBETPAN_EXPORT | |
85 | 95 | MMAPString * mmap_string_set_size (MMAPString * string, |
86 | 96 | size_t len); |
87 | 97 | |
98 | LIBETPAN_EXPORT | |
88 | 99 | MMAPString * mmap_string_insert_len (MMAPString * string, |
89 | 100 | size_t pos, |
90 | 101 | const char * val, |
91 | 102 | size_t len); |
92 | 103 | |
104 | LIBETPAN_EXPORT | |
93 | 105 | MMAPString * mmap_string_append (MMAPString * string, |
94 | 106 | const char * val); |
95 | 107 | |
108 | LIBETPAN_EXPORT | |
96 | 109 | MMAPString * mmap_string_append_len (MMAPString * string, |
97 | 110 | const char * val, |
98 | 111 | size_t len); |
99 | 112 | |
113 | LIBETPAN_EXPORT | |
100 | 114 | MMAPString * mmap_string_append_c (MMAPString * string, |
101 | 115 | char c); |
102 | 116 | |
117 | LIBETPAN_EXPORT | |
103 | 118 | MMAPString * mmap_string_prepend (MMAPString * string, |
104 | 119 | const char * val); |
105 | 120 | |
121 | LIBETPAN_EXPORT | |
106 | 122 | MMAPString * mmap_string_prepend_c (MMAPString * string, |
107 | 123 | char c); |
108 | 124 | |
125 | LIBETPAN_EXPORT | |
109 | 126 | MMAPString * mmap_string_prepend_len (MMAPString * string, |
110 | 127 | const char * val, |
111 | 128 | size_t len); |
112 | 129 | |
130 | LIBETPAN_EXPORT | |
113 | 131 | MMAPString * mmap_string_insert (MMAPString * string, |
114 | 132 | size_t pos, |
115 | 133 | const char * val); |
116 | 134 | |
135 | LIBETPAN_EXPORT | |
117 | 136 | MMAPString * mmap_string_insert_c (MMAPString *string, |
118 | 137 | size_t pos, |
119 | 138 | char c); |
120 | 139 | |
140 | LIBETPAN_EXPORT | |
121 | 141 | MMAPString * mmap_string_erase(MMAPString * string, |
122 | 142 | size_t pos, |
123 | 143 | size_t len); |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "data_message_driver.h" |
61 | 61 | |
62 | 62 | |
63 | 63 | static mailmessage_driver local_data_message_driver = { |
64 | #ifdef _MSC_VER | |
64 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
65 | 65 | /* msg_name */ "data", |
66 | 66 | |
67 | 67 | /* msg_initialize */ mailmessage_generic_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "dbdriver.h" |
86 | 86 | const char * uid, mailmessage ** result); |
87 | 87 | |
88 | 88 | static mailsession_driver local_db_session_driver = { |
89 | #ifdef _MSC_VER | |
89 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
90 | 90 | /* sess_name */ "db", |
91 | 91 | |
92 | 92 | /* sess_initialize */ initialize, |
129 | 129 | /* sess_get_messages_list */ get_messages_list, |
130 | 130 | /* sess_get_envelopes_list */ get_envelopes_list, |
131 | 131 | /* sess_remove_message */ NULL, |
132 | /* sess_login_sasl */ NULL, | |
132 | 133 | |
133 | 134 | #else |
134 | 135 | .sess_name = "db", |
173 | 174 | |
174 | 175 | .sess_get_message = get_message, |
175 | 176 | .sess_get_message_by_uid = get_message_by_uid, |
177 | .sess_login_sasl = NULL, | |
176 | 178 | #endif |
177 | 179 | }; |
178 | 180 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "dbdriver_message.h" |
62 | 62 | static void check(mailmessage * msg_info); |
63 | 63 | |
64 | 64 | static mailmessage_driver local_db_message_driver = { |
65 | #ifdef _MSC_VER | |
65 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
66 | 66 | /* msg_name */ "db", |
67 | 67 | |
68 | 68 | /* msg_initialize */ initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "dbstorage.h" |
52 | 52 | static void db_mailstorage_uninitialize(struct mailstorage * storage); |
53 | 53 | |
54 | 54 | static mailstorage_driver db_mailstorage_driver = { |
55 | #ifdef _MSC_VER | |
55 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
56 | 56 | /* sto_name */ "db", |
57 | 57 | /* sto_connect */ db_mailstorage_connect, |
58 | 58 | /* sto_get_folder_session */ db_mailstorage_get_folder_session, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "imapdriver.h" |
125 | 125 | const char * uid, |
126 | 126 | mailmessage ** result); |
127 | 127 | |
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 | ||
128 | 136 | static mailsession_driver local_imap_session_driver = { |
129 | #ifdef _MSC_VER | |
137 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
130 | 138 | /* sess_name */ "imap", |
131 | 139 | |
132 | 140 | /* sess_initialize */ imapdriver_initialize, |
172 | 180 | #if 0 |
173 | 181 | /* sess_search_messages */ imapdriver_search_messages, |
174 | 182 | #endif |
183 | /* sess_login_sasl */ imapdriver_login_sasl, | |
175 | 184 | |
176 | 185 | #else |
177 | 186 | .sess_name = "imap", |
219 | 228 | |
220 | 229 | .sess_get_message = imapdriver_get_message, |
221 | 230 | .sess_get_message_by_uid = imapdriver_get_message_by_uid, |
231 | .sess_login_sasl = imapdriver_login_sasl, | |
222 | 232 | #endif |
223 | 233 | }; |
224 | 234 | |
1272 | 1282 | |
1273 | 1283 | return imapdriver_get_message(session, num, result); |
1274 | 1284 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "imapdriver_cached.h" |
135 | 135 | const char * uid, |
136 | 136 | mailmessage ** result); |
137 | 137 | |
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 | ||
138 | 146 | static mailsession_driver local_imap_cached_session_driver = { |
139 | #ifdef _MSC_VER | |
147 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
140 | 148 | /* sess_name */ "imap-cached", |
141 | 149 | |
142 | 150 | /* sess_initialize */ imapdriver_cached_initialize, |
182 | 190 | #if 0 |
183 | 191 | /* sess_search_messages */ imapdriver_cached_search_messages, |
184 | 192 | #endif |
193 | /* sess_cached_login_sasl */ imapdriver_cached_login_sasl, | |
185 | 194 | |
186 | 195 | #else |
187 | 196 | .sess_name = "imap-cached", |
229 | 238 | |
230 | 239 | .sess_get_message = imapdriver_cached_get_message, |
231 | 240 | .sess_get_message_by_uid = imapdriver_cached_get_message_by_uid, |
241 | .sess_login_sasl = imapdriver_cached_login_sasl, | |
232 | 242 | #endif |
233 | 243 | }; |
234 | 244 | |
1421 | 1431 | |
1422 | 1432 | return imapdriver_cached_get_message(session, num, result); |
1423 | 1433 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "imapdriver_cached_message.h" |
101 | 101 | struct mail_flags ** result); |
102 | 102 | |
103 | 103 | static mailmessage_driver local_imap_cached_message_driver = { |
104 | #ifdef _MSC_VER | |
104 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
105 | 105 | /* msg_name */ "imap-cached", |
106 | 106 | |
107 | 107 | /* msg_initialize */ imap_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "imapdriver_message.h" |
96 | 96 | static void imap_check(mailmessage * msg_info); |
97 | 97 | |
98 | 98 | static mailmessage_driver local_imap_message_driver = { |
99 | #ifdef _MSC_VER | |
99 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
100 | 100 | /* msg_name */ "imap", |
101 | 101 | |
102 | 102 | /* msg_initialize */ imap_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef IMAPDRIVER_TYPES_H |
115 | 115 | int imap_connection_type; |
116 | 116 | |
117 | 117 | int imap_auth_type; |
118 | char * imap_login; | |
119 | char * imap_password; | |
118 | char * imap_login; /* deprecated */ | |
119 | char * imap_password; /* deprecated */ | |
120 | 120 | |
121 | 121 | int imap_cached; |
122 | 122 | 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; | |
123 | 135 | }; |
124 | 136 | |
125 | 137 | /* this is the type of IMAP4rev1 authentication */ |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "imapstorage.h" |
55 | 55 | static void imap_mailstorage_uninitialize(struct mailstorage * storage); |
56 | 56 | |
57 | 57 | static mailstorage_driver imap_mailstorage_driver = { |
58 | #ifdef _MSC_VER | |
58 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
59 | 59 | /* sto_name */ "imap", |
60 | 60 | /* sto_connect */ imap_mailstorage_connect, |
61 | 61 | /* sto_get_folder_session */ imap_mailstorage_get_folder_session, |
77 | 77 | int imap_cached, char * imap_cache_directory) |
78 | 78 | { |
79 | 79 | 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; | |
80 | 117 | |
81 | 118 | imap_storage = malloc(sizeof(* imap_storage)); |
82 | 119 | if (imap_storage == NULL) |
116 | 153 | else |
117 | 154 | imap_storage->imap_command = NULL; |
118 | 155 | |
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) | |
124 | 163 | goto free_command; |
125 | 164 | } |
126 | 165 | 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) | |
132 | 203 | goto free_login; |
133 | 204 | } |
134 | 205 | 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; | |
136 | 223 | |
137 | 224 | imap_storage->imap_cached = imap_cached; |
138 | 225 | |
139 | 226 | if (imap_cached && (imap_cache_directory != NULL)) { |
140 | 227 | imap_storage->imap_cache_directory = strdup(imap_cache_directory); |
141 | 228 | if (imap_storage->imap_cache_directory == NULL) |
142 | goto free_password; | |
229 | goto free_realm; | |
143 | 230 | } |
144 | 231 | else { |
145 | 232 | imap_storage->imap_cached = FALSE; |
151 | 238 | |
152 | 239 | return MAIL_NO_ERROR; |
153 | 240 | |
241 | free_realm: | |
242 | free(imap_storage->imap_sasl.sasl_realm); | |
154 | 243 | 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); | |
156 | 247 | 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); | |
158 | 257 | free_command: |
159 | 258 | free(imap_storage->imap_command); |
160 | 259 | free_servername: |
173 | 272 | |
174 | 273 | if (imap_storage->imap_cache_directory != NULL) |
175 | 274 | 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 | ||
180 | 285 | if (imap_storage->imap_command != NULL) |
181 | 286 | free(imap_storage->imap_command); |
182 | 287 | free(imap_storage->imap_servername); |
200 | 305 | driver = imap_cached_session_driver; |
201 | 306 | else |
202 | 307 | driver = imap_session_driver; |
203 | ||
308 | ||
204 | 309 | r = mailstorage_generic_connect(driver, |
205 | 310 | imap_storage->imap_servername, |
206 | 311 | imap_storage->imap_port, |
220 | 325 | goto err; |
221 | 326 | } |
222 | 327 | |
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 | } | |
227 | 345 | if (r != MAIL_NO_ERROR) { |
228 | 346 | res = r; |
229 | 347 | goto free; |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef IMAPSTORAGE_H |
83 | 83 | char * imap_login, char * imap_password, |
84 | 84 | int imap_cached, char * imap_cache_directory); |
85 | 85 | |
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 | ||
86 | 99 | #ifdef __cplusplus |
87 | 100 | } |
88 | 101 | #endif |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | |
104 | 104 | |
105 | 105 | static mailsession_driver local_maildir_session_driver = { |
106 | 106 | |
107 | #ifdef _MSC_VER | |
107 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
108 | 108 | |
109 | 109 | /* sess_name */ "maildir", |
110 | 110 | |
151 | 151 | #if 0 |
152 | 152 | /* sess_search_messages */ maildriver_generic_search_messages, |
153 | 153 | #endif |
154 | /* sess_login_sasl */ NULL, | |
154 | 155 | |
155 | 156 | #else |
156 | 157 | .sess_name = "maildir", |
198 | 199 | |
199 | 200 | .sess_get_message = NULL, |
200 | 201 | .sess_get_message_by_uid = get_message_by_uid, |
202 | .sess_login_sasl = NULL, | |
201 | 203 | |
202 | 204 | #endif |
203 | 205 | }; |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "maildirdriver.h" |
105 | 105 | const char * uid, mailmessage ** result); |
106 | 106 | |
107 | 107 | static mailsession_driver local_maildir_cached_session_driver = { |
108 | #ifdef _MSC_VER | |
108 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
109 | 109 | /* sess_name */ "maildir-cached", |
110 | 110 | |
111 | 111 | /* sess_initialize */ initialize, |
151 | 151 | #if 0 |
152 | 152 | /* sess_search_messages */ maildriver_generic_search_messages, |
153 | 153 | #endif |
154 | /* sess_login_sasl */ NULL, | |
154 | 155 | |
155 | 156 | #else |
156 | 157 | .sess_name = "maildir-cached", |
198 | 199 | |
199 | 200 | .sess_get_message = get_message, |
200 | 201 | .sess_get_message_by_uid = get_message_by_uid, |
202 | .sess_login_sasl = NULL, | |
201 | 203 | #endif |
202 | 204 | }; |
203 | 205 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "maildirdriver_message.h" |
73 | 73 | static void check(mailmessage * msg_info); |
74 | 74 | |
75 | 75 | static mailmessage_driver local_maildir_cached_message_driver = { |
76 | #ifdef _MSC_VER | |
76 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
77 | 77 | /* msg_name */ "maildir-cached", |
78 | 78 | |
79 | 79 | /* msg_initialize */ initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "maildirdriver_message.h" |
73 | 73 | static void check(mailmessage * msg_info); |
74 | 74 | |
75 | 75 | static mailmessage_driver local_maildir_message_driver = { |
76 | #ifdef _MSC_VER | |
76 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
77 | 77 | /* msg_name */ "maildir", |
78 | 78 | |
79 | 79 | /* msg_initialize */ initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "maildirstorage.h" |
53 | 53 | static void maildir_mailstorage_uninitialize(struct mailstorage * storage); |
54 | 54 | |
55 | 55 | static mailstorage_driver maildir_mailstorage_driver = { |
56 | #ifdef _MSC_VER | |
56 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
57 | 57 | /* sto_name */ "maildir", |
58 | 58 | /* sto_connect */ maildir_mailstorage_connect, |
59 | 59 | /* sto_get_folder_session */ maildir_mailstorage_get_folder_session, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mboxdriver.h" |
100 | 100 | mailmessage ** result); |
101 | 101 | |
102 | 102 | static mailsession_driver local_mbox_session_driver = { |
103 | #ifdef _MSC_VER | |
103 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
104 | 104 | /* sess_name */ "mbox", |
105 | 105 | |
106 | 106 | /* sess_initialize */ mboxdriver_initialize, |
147 | 147 | #if 0 |
148 | 148 | /* sess_search_messages */ maildriver_generic_search_messages, |
149 | 149 | #endif |
150 | /* sess_login_sasl */ NULL, | |
150 | 151 | |
151 | 152 | #else |
152 | 153 | .sess_name = "mbox", |
194 | 195 | |
195 | 196 | .sess_get_message = mboxdriver_get_message, |
196 | 197 | .sess_get_message_by_uid = mboxdriver_get_message_by_uid, |
198 | .sess_login_sasl = NULL, | |
197 | 199 | #endif |
198 | 200 | }; |
199 | 201 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mboxdriver_cached.h" |
111 | 111 | mailmessage ** result); |
112 | 112 | |
113 | 113 | static mailsession_driver local_mbox_cached_session_driver = { |
114 | #ifdef _MSC_VER | |
114 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
115 | 115 | /* sess_name */ "mbox-cached", |
116 | 116 | |
117 | 117 | /* sess_initialize */ mboxdriver_cached_initialize, |
158 | 158 | #if 0 |
159 | 159 | /* sess_search_messages */ maildriver_generic_search_messages, |
160 | 160 | #endif |
161 | /* sess_login_sasl */ NULL, | |
161 | 162 | |
162 | 163 | #else |
163 | 164 | .sess_name = "mbox-cached", |
206 | 207 | |
207 | 208 | .sess_get_message = mboxdriver_cached_get_message, |
208 | 209 | .sess_get_message_by_uid = mboxdriver_cached_get_message_by_uid, |
210 | .sess_login_sasl = NULL, | |
209 | 211 | #endif |
210 | 212 | }; |
211 | 213 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mboxdriver_cached_message.h" |
77 | 77 | size_t * result_len); |
78 | 78 | |
79 | 79 | static mailmessage_driver local_mbox_cached_message_driver = { |
80 | #ifdef _MSC_VER | |
80 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
81 | 81 | /* msg_name */ "mbox-cached", |
82 | 82 | |
83 | 83 | /* msg_initialize */ mbox_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mboxdriver_message.h" |
65 | 65 | size_t * result_len); |
66 | 66 | |
67 | 67 | static mailmessage_driver local_mbox_message_driver = { |
68 | #ifdef _MSC_VER | |
68 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
69 | 69 | /* msg_name */ "mbox", |
70 | 70 | |
71 | 71 | /* msg_initialize */ mbox_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mboxstorage.h" |
52 | 52 | static void mbox_mailstorage_uninitialize(struct mailstorage * storage); |
53 | 53 | |
54 | 54 | static mailstorage_driver mbox_mailstorage_driver = { |
55 | #ifdef _MSC_VER | |
55 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
56 | 56 | /* sto_name */ "mbox", |
57 | 57 | /* sto_connect */ mbox_mailstorage_connect, |
58 | 58 | /* sto_get_folder_session */ mbox_mailstorage_get_folder_session, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mhdriver.h" |
111 | 111 | mailmessage ** result); |
112 | 112 | |
113 | 113 | static mailsession_driver local_mh_session_driver = { |
114 | #ifdef _MSC_VER | |
114 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
115 | 115 | /* sess_name */ "mh", |
116 | 116 | |
117 | 117 | /* sess_initialize */ mhdriver_initialize, |
157 | 157 | #if 0 |
158 | 158 | /* sess_search_messages */ maildriver_generic_search_messages, |
159 | 159 | #endif |
160 | /* sess_login_sasl */ NULL, | |
160 | 161 | |
161 | 162 | #else |
162 | 163 | .sess_name = "mh", |
204 | 205 | |
205 | 206 | .sess_get_message = mhdriver_get_message, |
206 | 207 | .sess_get_message_by_uid = mhdriver_get_message_by_uid, |
208 | .sess_login_sasl = NULL, | |
207 | 209 | #endif |
208 | 210 | }; |
209 | 211 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mhdriver_cached.h" |
138 | 138 | mailmessage ** result); |
139 | 139 | |
140 | 140 | static mailsession_driver local_mh_cached_session_driver = { |
141 | #ifdef _MSC_VER | |
141 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
142 | 142 | /* sess_name */ "mh-cached", |
143 | 143 | |
144 | 144 | /* sess_initialize */ mhdriver_cached_initialize, |
184 | 184 | #if 0 |
185 | 185 | /* sess_search_messages */ maildriver_generic_search_messages, |
186 | 186 | #endif |
187 | /* sess_login_sasl */ NULL, | |
187 | 188 | |
188 | 189 | #else |
189 | 190 | .sess_name = "mh-cached", |
231 | 232 | |
232 | 233 | .sess_get_message = mhdriver_cached_get_message, |
233 | 234 | .sess_get_message_by_uid = mhdriver_cached_get_message_by_uid, |
235 | .sess_login_sasl = NULL, | |
234 | 236 | #endif |
235 | 237 | }; |
236 | 238 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mhdriver_message.h" |
77 | 77 | size_t * result_len); |
78 | 78 | |
79 | 79 | static mailmessage_driver local_mh_cached_message_driver = { |
80 | #ifdef _MSC_VER | |
80 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
81 | 81 | /* msg_name */ "mh-cached", |
82 | 82 | |
83 | 83 | /* msg_initialize */ mh_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mhdriver_message.h" |
65 | 65 | size_t * result_len); |
66 | 66 | |
67 | 67 | static mailmessage_driver local_mh_message_driver = { |
68 | #ifdef _MSC_VER | |
68 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
69 | 69 | /* msg_name */ "mh", |
70 | 70 | |
71 | 71 | /* msg_initialize */ mh_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mhstorage.h" |
49 | 49 | static void mh_mailstorage_uninitialize(struct mailstorage * storage); |
50 | 50 | |
51 | 51 | static mailstorage_driver mh_mailstorage_driver = { |
52 | #ifdef _MSC_VER | |
52 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
53 | 53 | /* sto_name */ "mh", |
54 | 54 | /* sto_connect */ mh_mailstorage_connect, |
55 | 55 | /* sto_get_folder_session */ mh_mailstorage_get_folder_session, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mime_message_driver.h" |
889 | 889 | |
890 | 890 | |
891 | 891 | static mailmessage_driver local_mime_message_driver = { |
892 | #ifdef _MSC_VER | |
892 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
893 | 893 | /* msg_name */ "mime", |
894 | 894 | |
895 | 895 | /* msg_initialize */ initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "nntpdriver.h" |
99 | 99 | static int nntpdriver_noop(mailsession * session); |
100 | 100 | |
101 | 101 | static mailsession_driver local_nntp_session_driver = { |
102 | #ifdef _MSC_VER | |
102 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
103 | 103 | /* sess_name */ "nntp", |
104 | 104 | |
105 | 105 | /* sess_initialize */ nntpdriver_initialize, |
145 | 145 | #if 0 |
146 | 146 | /* sess_search_messages */ maildriver_generic_search_messages, |
147 | 147 | #endif |
148 | /* sess_login_sasl */ NULL, | |
148 | 149 | |
149 | 150 | #else |
150 | 151 | .sess_name = "nntp", |
192 | 193 | |
193 | 194 | .sess_get_message = nntpdriver_get_message, |
194 | 195 | .sess_get_message_by_uid = nntpdriver_get_message_by_uid, |
196 | .sess_login_sasl = NULL, | |
195 | 197 | #endif |
196 | 198 | }; |
197 | 199 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "nntpdriver_cached.h" |
139 | 139 | mailmessage ** result); |
140 | 140 | |
141 | 141 | static mailsession_driver local_nntp_cached_session_driver = { |
142 | #ifdef _MSC_VER | |
142 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
143 | 143 | /* sess_name */ "nntp-cached", |
144 | 144 | |
145 | 145 | /* sess_initialize */ nntpdriver_cached_initialize, |
185 | 185 | #if 0 |
186 | 186 | /* sess_search_messages */ maildriver_generic_search_messages, |
187 | 187 | #endif |
188 | /* sess_login_sasl */ NULL, | |
188 | 189 | |
189 | 190 | #else |
190 | 191 | .sess_name = "nntp-cached", |
232 | 233 | |
233 | 234 | .sess_get_message = nntpdriver_cached_get_message, |
234 | 235 | .sess_get_message_by_uid = nntpdriver_cached_get_message_by_uid, |
236 | .sess_login_sasl = NULL, | |
235 | 237 | #endif |
236 | 238 | }; |
237 | 239 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "nntpdriver_cached_message.h" |
70 | 70 | struct mail_flags ** result); |
71 | 71 | |
72 | 72 | static mailmessage_driver local_nntp_cached_message_driver = { |
73 | #ifdef _MSC_VER | |
73 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
74 | 74 | /* msg_name */ "nntp-cached", |
75 | 75 | |
76 | 76 | /* msg_initialize */ nntp_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "nntpdriver_message.h" |
55 | 55 | size_t * result); |
56 | 56 | |
57 | 57 | static mailmessage_driver local_nntp_message_driver = { |
58 | #ifdef _MSC_VER | |
58 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
59 | 59 | |
60 | 60 | /* msg_name */ "nntp", |
61 | 61 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "nntpstorage.h" |
54 | 54 | static void nntp_mailstorage_uninitialize(struct mailstorage * storage); |
55 | 55 | |
56 | 56 | static mailstorage_driver nntp_mailstorage_driver = { |
57 | #ifdef _MSC_VER | |
57 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
58 | 58 | /* sto_name */ "nntp", |
59 | 59 | /* sto_connect */ nntp_mailstorage_connect, |
60 | 60 | /* sto_get_folder_session */ nntp_mailstorage_get_folder_session, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "pop3driver.h" |
75 | 75 | static int pop3driver_get_message(mailsession * session, |
76 | 76 | uint32_t num, mailmessage ** result); |
77 | 77 | |
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 | ||
78 | 86 | static mailsession_driver local_pop3_session_driver = { |
79 | #ifdef _MSC_VER | |
87 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
80 | 88 | |
81 | 89 | /* sess_name */ "pop3", |
82 | 90 | |
123 | 131 | #if 0 |
124 | 132 | /* sess_search_messages */ maildriver_generic_search_messages, |
125 | 133 | #endif |
126 | ||
134 | /* sess_login_sasl */ pop3driver_login_sasl, | |
135 | ||
127 | 136 | #else |
128 | 137 | .sess_name = "pop3", |
129 | 138 | |
170 | 179 | |
171 | 180 | .sess_get_message = pop3driver_get_message, |
172 | 181 | .sess_get_message_by_uid = NULL, |
182 | .sess_login_sasl = pop3driver_login_sasl, | |
173 | 183 | #endif |
174 | 184 | }; |
175 | 185 | |
435 | 445 | |
436 | 446 | return MAIL_NO_ERROR; |
437 | 447 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "pop3driver_cached.h" |
114 | 114 | static int pop3driver_cached_get_message_by_uid(mailsession * session, |
115 | 115 | const char * uid, mailmessage ** result); |
116 | 116 | |
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 | ||
117 | 125 | static mailsession_driver local_pop3_cached_session_driver = { |
118 | #ifdef _MSC_VER | |
126 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
119 | 127 | /* sess_name */ "pop3-cached", |
120 | 128 | |
121 | 129 | /* sess_initialize */ pop3driver_cached_initialize, |
161 | 169 | #if 0 |
162 | 170 | /* sess_search_messages */ maildriver_generic_search_messages, |
163 | 171 | #endif |
164 | ||
172 | /* sess_login_sasl */ pop3driver_cached_login_sasl, | |
173 | ||
165 | 174 | #else |
166 | 175 | .sess_name = "pop3-cached", |
167 | 176 | |
208 | 217 | |
209 | 218 | .sess_get_message = pop3driver_cached_get_message, |
210 | 219 | .sess_get_message_by_uid = pop3driver_cached_get_message_by_uid, |
220 | .sess_login_sasl = pop3driver_cached_login_sasl, | |
211 | 221 | #endif |
212 | 222 | }; |
213 | 223 | |
947 | 957 | |
948 | 958 | return pop3driver_cached_get_message(session, msg_info->msg_index, result); |
949 | 959 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "pop3driver_cached_message.h" |
70 | 70 | static void pop3_uninitialize(mailmessage * msg_info); |
71 | 71 | |
72 | 72 | static mailmessage_driver local_pop3_cached_message_driver = { |
73 | #ifdef _MSC_VER | |
73 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
74 | 74 | /* msg_name */ "pop3-cached", |
75 | 75 | |
76 | 76 | /* msg_initialize */ pop3_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "pop3driver_message.h" |
55 | 55 | size_t * result); |
56 | 56 | |
57 | 57 | static mailmessage_driver local_pop3_message_driver = { |
58 | #ifdef _MSC_VER | |
58 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
59 | 59 | /* msg_name */ "pop3", |
60 | 60 | |
61 | 61 | /* msg_initialize */ pop3_initialize, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef POP3DRIVER_TYPES_H |
121 | 121 | int pop3_connection_type; |
122 | 122 | |
123 | 123 | int pop3_auth_type; |
124 | char * pop3_login; | |
125 | char * pop3_password; | |
124 | char * pop3_login; /* deprecated */ | |
125 | char * pop3_password; /* deprecated */ | |
126 | 126 | |
127 | 127 | int pop3_cached; |
128 | 128 | char * pop3_cache_directory; |
129 | 129 | 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; | |
130 | 142 | }; |
131 | 143 | |
132 | 144 | /* this is the type of POP3 authentication */ |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "pop3storage.h" |
52 | 52 | static void pop3_mailstorage_uninitialize(struct mailstorage * storage); |
53 | 53 | |
54 | 54 | static mailstorage_driver pop3_mailstorage_driver = { |
55 | #ifdef _MSC_VER | |
55 | #if defined (_MSC_VER) || defined (__SUNPRO_CC) | |
56 | 56 | /* sto_name */ "pop3", |
57 | 57 | /* sto_connect */ pop3_mailstorage_connect, |
58 | 58 | /* sto_get_folder_session */ pop3_mailstorage_get_folder_session, |
74 | 74 | int pop3_cached, char * pop3_cache_directory, char * pop3_flags_directory) |
75 | 75 | { |
76 | 76 | 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; | |
77 | 116 | |
78 | 117 | pop3_storage = malloc(sizeof(* pop3_storage)); |
79 | 118 | if (pop3_storage == NULL) |
113 | 152 | else |
114 | 153 | pop3_storage->pop3_command = NULL; |
115 | 154 | |
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) | |
121 | 162 | goto free_command; |
122 | 163 | } |
123 | 164 | 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) | |
129 | 202 | goto free_login; |
130 | 203 | } |
131 | 204 | 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 | ||
134 | 223 | pop3_storage->pop3_cached = pop3_cached; |
135 | 224 | |
136 | 225 | if (pop3_cached && (pop3_cache_directory != NULL) && |
137 | 226 | (pop3_flags_directory != NULL)) { |
138 | 227 | pop3_storage->pop3_cache_directory = strdup(pop3_cache_directory); |
139 | 228 | if (pop3_storage->pop3_cache_directory == NULL) |
140 | goto free_password; | |
229 | goto free_realm; | |
141 | 230 | pop3_storage->pop3_flags_directory = strdup(pop3_flags_directory); |
142 | 231 | if (pop3_storage->pop3_flags_directory == NULL) |
143 | 232 | goto free_cache_directory; |
155 | 244 | |
156 | 245 | free_cache_directory: |
157 | 246 | free(pop3_storage->pop3_cache_directory); |
247 | free_realm: | |
248 | free(pop3_storage->pop3_sasl.sasl_realm); | |
158 | 249 | 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); | |
161 | 253 | 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); | |
164 | 263 | free_command: |
165 | 264 | if (pop3_storage->pop3_command != NULL) |
166 | 265 | free(pop3_storage->pop3_command); |
183 | 282 | free(pop3_storage->pop3_flags_directory); |
184 | 283 | if (pop3_storage->pop3_cache_directory != NULL) |
185 | 284 | 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 | ||
190 | 295 | if (pop3_storage->pop3_command != NULL) |
191 | 296 | free(pop3_storage->pop3_command); |
192 | 297 | free(pop3_storage->pop3_servername); |
247 | 352 | mailsession_parameters(session, POP3DRIVER_SET_AUTH_TYPE, &auth_type); |
248 | 353 | } |
249 | 354 | |
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 | } | |
254 | 372 | if (r != MAIL_NO_ERROR) { |
255 | 373 | if (pop3_storage->pop3_auth_type == POP3_AUTH_TYPE_TRY_APOP) { |
256 | 374 | /* try in clear authentication */ |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef POP3STORAGE_H |
88 | 88 | int pop3_cached, char * pop3_cache_directory, |
89 | 89 | char * pop3_flags_directory); |
90 | 90 | |
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 | ||
91 | 105 | #ifdef __cplusplus |
92 | 106 | } |
93 | 107 | #endif |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "maildriver.h" |
415 | 415 | |
416 | 416 | return session->sess_driver->sess_get_message_by_uid(session, uid, result); |
417 | 417 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef MAILDRIVER_H |
573 | 573 | int mailsession_get_message_by_uid(mailsession * session, |
574 | 574 | const char * uid, mailmessage ** result); |
575 | 575 | |
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 | ||
576 | 602 | #ifdef __cplusplus |
577 | 603 | } |
578 | 604 | #endif |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef MAILDRIVER_TYPES_H |
457 | 457 | STARTTLS. |
458 | 458 | - get_message_by_uid() so that the application can remember the message |
459 | 459 | by UID and build its own list of messages. |
460 | - login_sasl() notifies the SASL information to authenticate to the | |
461 | session. | |
460 | 462 | |
461 | 463 | * drivers' specific : |
462 | 464 | |
542 | 544 | struct mail_search_key * key, |
543 | 545 | struct mail_search_result ** result); |
544 | 546 | #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); | |
545 | 554 | }; |
546 | 555 | |
547 | 556 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailstorage_tools.h" |
101 | 101 | /* SEB unsupported on Windows */ |
102 | 102 | #ifndef WIN32 |
103 | 103 | |
104 | #define ENV_BUFFER_SIZE 512 | |
105 | ||
104 | 106 | static void do_exec_command(int fd, const char *command, |
105 | 107 | char *servername, uint16_t port) |
106 | 108 | { |
107 | 109 | int i, maxopen; |
110 | #ifdef SOLARIS | |
111 | char env_buffer[ENV_BUFFER_SIZE]; | |
112 | #endif | |
108 | 113 | |
109 | 114 | if (fork() > 0) { |
110 | 115 | /* Fork again to become a child of init rather than |
112 | 117 | exit(0); |
113 | 118 | } |
114 | 119 | |
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 | |
115 | 127 | if (servername) |
116 | 128 | setenv("ETPANSERVER", servername, 1); |
117 | 129 | else |
118 | 130 | 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 | |
120 | 140 | if (port) { |
121 | 141 | char porttext[20]; |
122 | 142 | |
126 | 146 | else { |
127 | 147 | unsetenv("ETPANPORT"); |
128 | 148 | } |
149 | #endif | |
129 | 150 | |
130 | 151 | /* Not a lot we can do if there's an error other than bail. */ |
131 | 152 | if (dup2(fd, 0) == -1) |
387 | 408 | err: |
388 | 409 | return res; |
389 | 410 | } |
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 | } |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailstorage.h" |
59 | 59 | char * login, |
60 | 60 | char * password); |
61 | 61 | |
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 | ||
62 | 71 | #ifdef __cplusplus |
63 | 72 | } |
64 | 73 | #endif |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailprivacy_gnupg.h" |
2539 | 2539 | return res; |
2540 | 2540 | } |
2541 | 2541 | |
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 | |
2543 | 2592 | static struct mailprivacy_encryption pgp_encryption_tab[] = { |
2544 | 2593 | /* PGP signed part */ |
2545 | 2594 | { |
2548 | 2597 | .encrypt = pgp_sign_mime, |
2549 | 2598 | }, |
2550 | 2599 | |
2551 | /* PGP encrypted part */ | |
2600 | /* pgp encrypted part */ | |
2552 | 2601 | |
2553 | 2602 | { |
2554 | 2603 | .name = "encrypted", |
2588 | 2637 | .encrypt = pgp_armor_sign_encrypt, |
2589 | 2638 | }, |
2590 | 2639 | }; |
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 | |
2592 | 2656 | static struct mailprivacy_protocol pgp_protocol = { |
2593 | 2657 | .name = "pgp", |
2594 | 2658 | .description = "OpenPGP", |
2601 | 2665 | |
2602 | 2666 | .encryption_tab = pgp_encryption_tab, |
2603 | 2667 | }; |
2668 | #endif | |
2604 | 2669 | |
2605 | 2670 | int mailprivacy_gnupg_init(struct mailprivacy * privacy) |
2606 | 2671 | { |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailprivacy_smime.h" |
71 | 71 | static int smime_is_signed(struct mailmime * mime) |
72 | 72 | { |
73 | 73 | 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 | ||
89 | 112 | return 0; |
90 | 113 | } |
91 | 114 | |
93 | 116 | { |
94 | 117 | if (mime->mm_content_type != NULL) { |
95 | 118 | 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 | ||
97 | 134 | return 1; |
98 | } | |
99 | ||
135 | } | |
136 | } | |
137 | ||
100 | 138 | return 0; |
101 | 139 | } |
102 | 140 | |
594 | 632 | |
595 | 633 | /* insert the signed part */ |
596 | 634 | 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 | } | |
606 | 646 | } |
607 | 647 | |
608 | 648 | r = mailprivacy_get_part_from_file(privacy, 1, |
651 | 691 | return smime_is_signed(mime); |
652 | 692 | |
653 | 693 | case MAILMIME_SINGLE: |
654 | return smime_is_encrypted(mime); | |
694 | return smime_is_encrypted(mime) || smime_is_signed(mime); | |
655 | 695 | } |
656 | 696 | |
657 | 697 | return 0; |
682 | 722 | r = MAIL_ERROR_INVAL; |
683 | 723 | if (smime_is_encrypted(mime)) |
684 | 724 | r = smime_decrypt(privacy, msg, mime, &alternative_mime); |
725 | else if (smime_is_signed(mime)) | |
726 | r = smime_verify(privacy, msg, mime, &alternative_mime); | |
685 | 727 | |
686 | 728 | if (r != MAIL_NO_ERROR) |
687 | 729 | return r; |
1311 | 1353 | } |
1312 | 1354 | |
1313 | 1355 | |
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 | |
1315 | 1382 | static struct mailprivacy_encryption smime_encryption_tab[] = { |
1316 | 1383 | /* S/MIME signed part */ |
1317 | 1384 | { |
1336 | 1403 | .encrypt = smime_sign_encrypt, |
1337 | 1404 | }, |
1338 | 1405 | }; |
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 | |
1340 | 1422 | static struct mailprivacy_protocol smime_protocol = { |
1341 | 1423 | .name = "smime", |
1342 | 1424 | .description = "S/MIME", |
1349 | 1431 | |
1350 | 1432 | .encryption_tab = smime_encryption_tab, |
1351 | 1433 | }; |
1434 | #endif | |
1352 | 1435 | |
1353 | 1436 | int mailprivacy_smime_init(struct mailprivacy * privacy) |
1354 | 1437 | { |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #include "mailmbox.h" |
57 | 57 | #include "mailmbox_parse.h" |
58 | 58 | #include "maillock.h" |
59 | 59 | |
60 | #if 0 | |
61 | #define CRLF_BADNESS | |
62 | #endif | |
63 | ||
60 | 64 | /* |
61 | 65 | http://www.qmail.org/qmail-manual-html/man5/mbox.html |
62 | 66 | RFC 2076 |
63 | 67 | */ |
64 | 68 | |
69 | /* used only in case the directory which contains the original file | |
70 | is not writable */ | |
65 | 71 | #define TMPDIR "/tmp" |
66 | 72 | |
67 | 73 | /* mbox is a file with a corresponding filename */ |
447 | 453 | if (!force_no_uid) { |
448 | 454 | /* UID header */ |
449 | 455 | |
456 | #ifdef CRLF_BADNESS | |
450 | 457 | fixed_size += strlen(UID_HEADER " \r\n"); |
458 | #else | |
459 | fixed_size += strlen(UID_HEADER " \n"); | |
460 | #endif | |
451 | 461 | |
452 | 462 | tmp_uid = uid; |
453 | 463 | while (tmp_uid >= 10) { |
559 | 569 | |
560 | 570 | memcpy(str, UID_HEADER " ", strlen(UID_HEADER " ")); |
561 | 571 | str += strlen(UID_HEADER " "); |
572 | #ifdef CRLF_BADNESS | |
562 | 573 | numlen = snprintf(str, 20, "%i\r\n", uid); |
574 | #else | |
575 | numlen = snprintf(str, 20, "%i\n", uid); | |
576 | #endif | |
563 | 577 | str += numlen; |
564 | 578 | } |
565 | 579 | |
610 | 624 | date = time(NULL); |
611 | 625 | from_size = strlen(DEFAULT_FROM_LINE); |
612 | 626 | 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 | |
613 | 630 | from_size = strftime(from_line, MAX_FROM_LINE_SIZE, "From - %c\n", &time_info); |
631 | #endif | |
614 | 632 | |
615 | 633 | maxuid = /* */ folder->mb_max_uid; |
616 | 634 | |
623 | 641 | extra_size += get_fixed_message_size(info->ai_message, info->ai_size, |
624 | 642 | folder->mb_max_uid + i + 1, |
625 | 643 | folder->mb_no_uid); |
644 | #ifdef CRLF_BADNESS | |
626 | 645 | extra_size += 2; /* CR LF */ |
646 | #else | |
647 | extra_size += 1; /* CR LF */ | |
648 | #endif | |
627 | 649 | |
628 | 650 | info->ai_uid = folder->mb_max_uid + i + 1; |
629 | 651 | } |
635 | 657 | crlf_count ++; |
636 | 658 | left --; |
637 | 659 | } |
660 | #ifdef CRLF_BADNESS | |
638 | 661 | else if (folder->mb_mapping[left - 1] == '\r') { |
639 | 662 | left --; |
640 | 663 | } |
664 | #endif | |
641 | 665 | else |
642 | 666 | break; |
643 | 667 | |
650 | 674 | |
651 | 675 | if (old_size != 0) { |
652 | 676 | if (crlf_count != 2) |
677 | #ifdef CRLF_BADNESS | |
653 | 678 | 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 | |
654 | 683 | } |
655 | 684 | |
656 | 685 | r = ftruncate(folder->mb_fd, extra_size + old_size); |
670 | 699 | |
671 | 700 | if (old_size != 0) { |
672 | 701 | for(i = 0 ; i < 2 - crlf_count ; i ++) { |
702 | #ifdef CRLF_BADNESS | |
673 | 703 | * str = '\r'; |
674 | 704 | str ++; |
705 | #endif | |
675 | 706 | * str = '\n'; |
676 | 707 | str ++; |
677 | 708 | } |
690 | 721 | folder->mb_max_uid + i + 1, |
691 | 722 | folder->mb_no_uid); |
692 | 723 | |
724 | #ifdef CRLF_BADNESS | |
693 | 725 | * str = '\r'; |
694 | 726 | str ++; |
727 | #endif | |
695 | 728 | * str = '\n'; |
696 | 729 | str ++; |
697 | 730 | } |
1147 | 1180 | if (!info->msg_written_uid) { |
1148 | 1181 | uint32_t uid; |
1149 | 1182 | |
1183 | #ifdef CRLF_BADNESS | |
1150 | 1184 | size += strlen(UID_HEADER " \r\n"); |
1185 | #else | |
1186 | size += strlen(UID_HEADER " \n"); | |
1187 | #endif | |
1151 | 1188 | |
1152 | 1189 | uid = info->msg_uid; |
1153 | 1190 | while (uid >= 10) { |
1189 | 1226 | |
1190 | 1227 | memcpy(dest + cur_offset, UID_HEADER " ", strlen(UID_HEADER " ")); |
1191 | 1228 | cur_offset += strlen(UID_HEADER " "); |
1229 | #ifdef CRLF_BADNESS | |
1192 | 1230 | numlen = snprintf(dest + cur_offset, size - cur_offset, |
1193 | 1231 | "%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 | |
1194 | 1236 | cur_offset += numlen; |
1195 | 1237 | } |
1196 | 1238 | } |
31 | 31 | */ |
32 | 32 | |
33 | 33 | /* |
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 $ | |
35 | 35 | */ |
36 | 36 | |
37 | 37 | #ifndef CONFIG_H |
41 | 41 | |
42 | 42 | #include "mailsmtp.h" |
43 | 43 | #include "connect.h" |
44 | #include "md5.h" | |
45 | 44 | #include "base64.h" |
46 | 45 | #include "mail.h" |
47 | 46 |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef MAILSMTP_H |
46 | 46 | #include <libetpan/mailsmtp_ssl.h> |
47 | 47 | |
48 | 48 | |
49 | LIBETPAN_EXPORT | |
49 | 50 | mailsmtp * mailsmtp_new(size_t progr_rate, |
50 | 51 | progress_function * progr_fun); |
52 | ||
53 | LIBETPAN_EXPORT | |
51 | 54 | void mailsmtp_free(mailsmtp * session); |
52 | 55 | |
56 | LIBETPAN_EXPORT | |
53 | 57 | int mailsmtp_connect(mailsmtp * session, mailstream * s); |
58 | ||
59 | LIBETPAN_EXPORT | |
54 | 60 | int mailsmtp_quit(mailsmtp * session); |
55 | 61 | |
56 | 62 | |
59 | 65 | * Tries AUTH with detected method - "better" method first: |
60 | 66 | * CRAM-MD5 -> PLAIN -> LOGIN |
61 | 67 | */ |
68 | LIBETPAN_EXPORT | |
62 | 69 | int mailsmtp_auth(mailsmtp * session, const char * user, const char * pass); |
63 | 70 | |
64 | 71 | /* This call is deprecated and mailesmtp_auth_sasl() should be used instead */ |
66 | 73 | * tries to autenticate with the server using given auth-type |
67 | 74 | * returns MAILSMTP_NO_ERROR on success |
68 | 75 | */ |
76 | LIBETPAN_EXPORT | |
69 | 77 | int mailsmtp_auth_type(mailsmtp * session, |
70 | 78 | const char * user, const char * pass, int type); |
71 | 79 | |
80 | LIBETPAN_EXPORT | |
72 | 81 | int mailsmtp_helo(mailsmtp * session); |
82 | ||
83 | LIBETPAN_EXPORT | |
73 | 84 | int mailsmtp_mail(mailsmtp * session, const char * from); |
85 | ||
86 | LIBETPAN_EXPORT | |
74 | 87 | int mailsmtp_rcpt(mailsmtp * session, const char * to); |
88 | ||
89 | LIBETPAN_EXPORT | |
75 | 90 | int mailsmtp_data(mailsmtp * session); |
91 | ||
92 | LIBETPAN_EXPORT | |
76 | 93 | int mailsmtp_data_message(mailsmtp * session, |
77 | 94 | const char * message, |
78 | 95 | size_t size); |
96 | ||
97 | LIBETPAN_EXPORT | |
79 | 98 | int mailesmtp_ehlo(mailsmtp * session); |
99 | ||
100 | LIBETPAN_EXPORT | |
80 | 101 | int mailesmtp_mail(mailsmtp * session, |
81 | 102 | const char * from, |
82 | 103 | int return_full, |
83 | 104 | const char * envid); |
105 | ||
106 | LIBETPAN_EXPORT | |
84 | 107 | int mailesmtp_rcpt(mailsmtp * session, |
85 | 108 | const char * to, |
86 | 109 | int notify, |
87 | 110 | const char * orcpt); |
111 | ||
112 | LIBETPAN_EXPORT | |
88 | 113 | int mailesmtp_starttls(mailsmtp * session); |
89 | 114 | |
115 | LIBETPAN_EXPORT | |
90 | 116 | const char * mailsmtp_strerror(int errnum); |
91 | 117 | |
118 | LIBETPAN_EXPORT | |
92 | 119 | int mailesmtp_auth_sasl(mailsmtp * session, const char * auth_type, |
93 | 120 | const char * server_fqdn, |
94 | 121 | const char * local_ip_port, |
29 | 29 | */ |
30 | 30 | |
31 | 31 | /* |
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 $ | |
33 | 33 | */ |
34 | 34 | |
35 | 35 | #ifndef MAILSMTP_SOCKET_H |
43 | 43 | #include <libetpan/libetpan-config.h> |
44 | 44 | #include <libetpan/mailsmtp_types.h> |
45 | 45 | |
46 | LIBETPAN_EXPORT | |
46 | 47 | int mailsmtp_socket_connect(mailsmtp * session, |
47 | 48 | const char * server, uint16_t port); |
49 | ||
50 | LIBETPAN_EXPORT | |
48 | 51 | int mailsmtp_socket_starttls(mailsmtp * session); |
49 | 52 | |
50 | 53 | #ifdef __cplusplus |
3 | 3 | */ |
4 | 4 | |
5 | 5 | #include <libetpan/libetpan.h> |
6 | #include <netdb.h> | |
7 | #include <netinet/in.h> | |
8 | #include <sys/socket.h> | |
9 | 6 | #include <stdlib.h> |
10 | 7 | #include <string.h> |
11 | 8 | #include <sys/types.h> |
12 | #include <sys/mman.h> | |
13 | 9 | #include <sys/stat.h> |
14 | #include <unistd.h> | |
15 | #include <sys/ioctl.h> | |
16 | 10 | #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 | |
21 | 27 | |
22 | 28 | /* globals */ |
23 | 29 | char *smtp_server; |
24 | uint smtp_port = 25; | |
30 | uint16_t smtp_port = 25; | |
25 | 31 | char *smtp_user; |
26 | 32 | char *smtp_password; |
27 | 33 | char *smtp_from; |
42 | 48 | |
43 | 49 | memset(message, 0, sizeof(struct mem_message)); |
44 | 50 | |
51 | #ifndef MMAP_UNAVAILABLE | |
45 | 52 | /* if stdin is a file whose size is known, try to mmap it */ |
46 | 53 | if (!fstat(0, &sb) && S_ISREG(sb.st_mode) && sb.st_size >= 0) { |
47 | 54 | message->len = sb.st_size; |
49 | 56 | STDIN_FILENO, 0)) != MAP_FAILED) |
50 | 57 | return 0; |
51 | 58 | } |
59 | #endif | |
52 | 60 | |
53 | 61 | /* read the buffer from stdin by blocks, until EOF or error. |
54 | 62 | save the message in a mmap_string */ |
83 | 91 | } |
84 | 92 | |
85 | 93 | char *guessfrom() { |
94 | #ifndef _MSC_VER | |
86 | 95 | uid_t uid; |
87 | 96 | struct passwd *pw; |
88 | 97 | char hostname[256]; |
110 | 119 | else |
111 | 120 | snprintf(gfrom, len, "#%u@%s", uid, hostname); |
112 | 121 | return gfrom; |
122 | #else | |
123 | return NULL; | |
124 | #endif | |
113 | 125 | } |
114 | 126 | |
115 | 127 | void release(struct mem_message *message) { |
116 | 128 | if (message->mstring != NULL) |
117 | 129 | mmap_string_free(message->mstring); |
130 | #ifndef MMAP_UNAVAILABLE | |
118 | 131 | else if (message->data != NULL) |
119 | 132 | munmap(message->data, message->len); |
133 | #endif | |
120 | 134 | } |
121 | 135 | |
122 | 136 | int send_message(char *data, size_t len, char**rcpts) { |
227 | 241 | smtp_server = strdup(optarg); |
228 | 242 | break; |
229 | 243 | case 'p': |
230 | smtp_port = strtoul(optarg, NULL, 10); | |
244 | smtp_port = (uint16_t) strtoul(optarg, NULL, 10); | |
231 | 245 | break; |
232 | 246 | case 'u': |
233 | 247 | if (smtp_user != NULL) |