Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
79b0dc3d
...
79b0dc3d9e025d6863ef1d5bbfdcbe7d7026c779
authored
2002-11-03 12:50:32 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed indentation.
1 parent
ba8d24dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
47 deletions
mail.local/main.c
mail.local/main.c
View file @
79b0dc3
...
...
@@ -292,46 +292,47 @@ make_tmp (const char *from, char **tempfile)
}
line
=
0
;
while
(
getline
(
&
buf
,
&
n
,
stdin
)
>
0
)
{
line
++
;
if
(
line
==
1
)
{
if
(
memcmp
(
buf
,
"From "
,
5
))
{
struct
mu_auth_data
*
auth
;
if
(
!
from
)
{
auth
=
mu_get_auth_by_uid
(
uid
);
if
(
auth
)
from
=
auth
->
name
;
}
if
(
from
)
{
time
(
&
t
);
fprintf
(
fp
,
"From %s %s"
,
from
,
ctime
(
&
t
));
}
else
{
mailer_err
(
"Can't determine sender address"
);
exit
(
EX_UNAVAILABLE
);
}
if
(
auth
)
mu_auth_data_free
(
auth
);
}
}
else
if
(
!
memcmp
(
buf
,
"From "
,
5
))
fputc
(
'>'
,
fp
);
if
(
fputs
(
buf
,
fp
)
==
EOF
)
{
mailer_err
(
"temporary file write error"
);
fclose
(
fp
);
return
NULL
;
}
}
while
(
getline
(
&
buf
,
&
n
,
stdin
)
>
0
)
{
line
++
;
if
(
line
==
1
)
{
if
(
memcmp
(
buf
,
"From "
,
5
))
{
struct
mu_auth_data
*
auth
;
if
(
!
from
)
{
auth
=
mu_get_auth_by_uid
(
uid
);
if
(
auth
)
from
=
auth
->
name
;
}
if
(
from
)
{
time
(
&
t
);
fprintf
(
fp
,
"From %s %s"
,
from
,
ctime
(
&
t
));
}
else
{
mailer_err
(
"Can't determine sender address"
);
exit
(
EX_UNAVAILABLE
);
}
if
(
auth
)
mu_auth_data_free
(
auth
);
}
}
else
if
(
!
memcmp
(
buf
,
"From "
,
5
))
fputc
(
'>'
,
fp
);
if
(
fputs
(
buf
,
fp
)
==
EOF
)
{
mailer_err
(
"temporary file write error"
);
fclose
(
fp
);
return
NULL
;
}
}
if
(
buf
&&
strchr
(
buf
,
'\n'
)
==
NULL
)
putc
(
'\n'
,
fp
);
putc
(
'\n'
,
fp
);
free
(
buf
);
...
...
@@ -465,15 +466,17 @@ deliver (FILE *fp, char *name)
n
=
0
;
status
=
0
;
fseek
(
fp
,
0
,
SEEK_SET
);
while
(
getline
(
&
buf
,
&
n
,
fp
)
>
0
)
{
status
=
stream_write
(
stream
,
buf
,
strlen
(
buf
),
off
,
&
nwr
);
if
(
status
)
{
mailer_err
(
"error writing to mailbox: %s"
,
mu_errstring
(
status
));
break
;
}
off
+=
nwr
;
}
while
(
getline
(
&
buf
,
&
n
,
fp
)
>
0
)
{
status
=
stream_write
(
stream
,
buf
,
strlen
(
buf
),
off
,
&
nwr
);
if
(
status
)
{
mailer_err
(
"error writing to mailbox: %s"
,
mu_errstring
(
status
));
break
;
}
off
+=
nwr
;
}
free
(
buf
);
switch_user_id
(
0
);
}
...
...
Please
register
or
sign in
to post a comment