Updated
Showing
11 changed files
with
77 additions
and
41 deletions
1 | 2003-12-25 Sergey Poznyakoff | ||
2 | |||
3 | Added changes from the backup repository | ||
4 | |||
1 | 2003-12-24 Sergey Poznyakoff | 5 | 2003-12-24 Sergey Poznyakoff |
2 | 6 | ||
3 | * examples/spamd.c: New file. | 7 | * examples/spamd.c: New file. |
... | @@ -58,7 +62,7 @@ | ... | @@ -58,7 +62,7 @@ |
58 | Date from Date to Repository | 62 | Date from Date to Repository |
59 | ======== ======= ========== | 63 | ======== ======= ========== |
60 | 1999-09-10 2003-12-01 Savannah | 64 | 1999-09-10 2003-12-01 Savannah |
61 | 2003-12-04 *** Mirddin | 65 | 2003-12-04 2003-12-25 Mirddin |
62 | 66 | ||
63 | 2003-12-05 Sergey Poznyakoff | 67 | 2003-12-05 Sergey Poznyakoff |
64 | 68 | ... | ... |
1 | Makefile | 1 | Makefile |
2 | Makefile.in | 2 | Makefile.in |
3 | iconv.m4 | ||
4 | codeset.m4 | 3 | codeset.m4 |
5 | gettext.m4 | 4 | gettext.m4 |
6 | glibc21.m4 | 5 | glibc21.m4 |
6 | iconv.m4 | ||
7 | intdiv0.m4 | 7 | intdiv0.m4 |
8 | inttypes-pri.m4 | 8 | intmax.m4 |
9 | inttypes.m4 | ||
10 | inttypes_h.m4 | 9 | inttypes_h.m4 |
10 | inttypes.m4 | ||
11 | inttypes-pri.m4 | ||
11 | isc-posix.m4 | 12 | isc-posix.m4 |
12 | lcmessage.m4 | 13 | lcmessage.m4 |
13 | lib-ld.m4 | 14 | lib-ld.m4 |
14 | lib-link.m4 | 15 | lib-link.m4 |
15 | lib-prefix.m4 | 16 | lib-prefix.m4 |
17 | longdouble.m4 | ||
18 | longlong.m4 | ||
16 | nls.m4 | 19 | nls.m4 |
17 | po.m4 | 20 | po.m4 |
21 | printf-posix.m4 | ||
18 | progtest.m4 | 22 | progtest.m4 |
23 | signed.m4 | ||
24 | size_max.m4 | ||
19 | stdint_h.m4 | 25 | stdint_h.m4 |
20 | uintmax_t.m4 | 26 | uintmax_t.m4 |
21 | ulonglong.m4 | 27 | ulonglong.m4 |
28 | wchar_t.m4 | ||
29 | wint_t.m4 | ||
30 | xsize.m4 | ... | ... |
... | @@ -339,6 +339,7 @@ mailbox_imap_open (mailbox_t mailbox, int flags) | ... | @@ -339,6 +339,7 @@ mailbox_imap_open (mailbox_t mailbox, int flags) |
339 | return status; | 339 | return status; |
340 | } | 340 | } |
341 | f_imap->state = IMAP_NO_STATE; | 341 | f_imap->state = IMAP_NO_STATE; |
342 | break; | ||
342 | 343 | ||
343 | default: | 344 | default: |
344 | status = EINVAL; | 345 | status = EINVAL; | ... | ... |
... | @@ -34,8 +34,6 @@ Things to consider: | ... | @@ -34,8 +34,6 @@ Things to consider: |
34 | 34 | ||
35 | --> Groups no longer show up in the address_t list. | 35 | --> Groups no longer show up in the address_t list. |
36 | 36 | ||
37 | - Need a way to parse "<>", it's a valid SMTP address... | ||
38 | |||
39 | - Need a way to parse ",,,", it's a valid address-list, it just doesn't | 37 | - Need a way to parse ",,,", it's a valid address-list, it just doesn't |
40 | have any addresses. | 38 | have any addresses. |
41 | 39 | ||
... | @@ -1022,6 +1020,13 @@ parse822_route_addr (const char **p, const char *e, address_t * a) | ... | @@ -1022,6 +1020,13 @@ parse822_route_addr (const char **p, const char *e, address_t * a) |
1022 | 1020 | ||
1023 | return rc; | 1021 | return rc; |
1024 | } | 1022 | } |
1023 | if (!(rc = parse822_special (p, e, '>'))) | ||
1024 | { | ||
1025 | (void) (((rc = fill_mb (a, 0, 0, 0, 0)) == EOK) | ||
1026 | && ((rc = str_append (&(*a)->email, "")) == EOK)); | ||
1027 | |||
1028 | return rc; | ||
1029 | } | ||
1025 | 1030 | ||
1026 | parse822_route (p, e, &route); | 1031 | parse822_route (p, e, &route); |
1027 | 1032 | ... | ... |
... | @@ -596,7 +596,7 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, | ... | @@ -596,7 +596,7 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, |
596 | case SMTP_ENV_FROM: | 596 | case SMTP_ENV_FROM: |
597 | ENV_FROM: | 597 | ENV_FROM: |
598 | { | 598 | { |
599 | status = smtp_writeline (smtp, "MAIL FROM: %s\r\n", smtp->mail_from); | 599 | status = smtp_writeline (smtp, "MAIL FROM: <%s>\r\n", smtp->mail_from); |
600 | CHECK_ERROR (smtp, status); | 600 | CHECK_ERROR (smtp, status); |
601 | smtp->state = SMTP_MAIL_FROM; | 601 | smtp->state = SMTP_MAIL_FROM; |
602 | } | 602 | } |
... | @@ -639,7 +639,7 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, | ... | @@ -639,7 +639,7 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, |
639 | CHECK_ERROR (smtp, status); | 639 | CHECK_ERROR (smtp, status); |
640 | } | 640 | } |
641 | 641 | ||
642 | status = smtp_writeline (smtp, "RCPT TO: %s\r\n", to); | 642 | status = smtp_writeline (smtp, "RCPT TO: <%s>\r\n", to); |
643 | 643 | ||
644 | free (to); | 644 | free (to); |
645 | 645 | ... | ... |
... | @@ -386,7 +386,8 @@ list-ietf-wg-apps-drums@faerber.muc.de (=?ISO-8859-1?Q?Claus_F=E4rber?=)=> pcoun | ... | @@ -386,7 +386,8 @@ list-ietf-wg-apps-drums@faerber.muc.de (=?ISO-8859-1?Q?Claus_F=E4rber?=)=> pcoun |
386 | 1 email <0xdeadbeef-request@petting-zoo.net> | 386 | 1 email <0xdeadbeef-request@petting-zoo.net> |
387 | local-part <0xdeadbeef-request> domain <petting-zoo.net> | 387 | local-part <0xdeadbeef-request> domain <petting-zoo.net> |
388 | 388 | ||
389 | <>=> error MU_ERR_BAD_822_FORMAT | 389 | <>=> pcount 1 |
390 | 1 email <> | ||
390 | 391 | ||
391 | <Christia.Roberts@nrc.ca>=> pcount 1 | 392 | <Christia.Roberts@nrc.ca>=> pcount 1 |
392 | 1 email <Christia.Roberts@nrc.ca> | 393 | 1 email <Christia.Roberts@nrc.ca> | ... | ... |
... | @@ -1822,40 +1822,12 @@ builtin_isreply (struct mh_machine *mach) | ... | @@ -1822,40 +1822,12 @@ builtin_isreply (struct mh_machine *mach) |
1822 | static void | 1822 | static void |
1823 | decode_string (strobj_t *obj) | 1823 | decode_string (strobj_t *obj) |
1824 | { | 1824 | { |
1825 | char *charset = NULL; | ||
1826 | char *tmp; | 1825 | char *tmp; |
1827 | int rc; | 1826 | |
1828 | |||
1829 | if (strobj_is_null (obj)) | 1827 | if (strobj_is_null (obj)) |
1830 | return; | 1828 | return; |
1831 | charset = mh_global_profile_get ("Charset", NULL); | ||
1832 | if (!charset) | ||
1833 | return; | ||
1834 | if (strcasecmp (charset, "auto") == 0) | ||
1835 | { | ||
1836 | /* Try to deduce the charset from LC_ALL variable */ | ||
1837 | |||
1838 | tmp = getenv ("LC_ALL"); | ||
1839 | if (tmp) | ||
1840 | { | ||
1841 | char *sp; | ||
1842 | char *lang; | ||
1843 | char *terr; | ||
1844 | 1829 | ||
1845 | lang = strtok_r (tmp, "_", &sp); | 1830 | if (mh_decode_2047 (strobj_ptr (obj), &tmp) == 0) |
1846 | terr = strtok_r (NULL, ".", &sp); | ||
1847 | charset = strtok_r (NULL, "@", &sp); | ||
1848 | |||
1849 | if (!charset) | ||
1850 | charset = mu_charset_lookup (lang, terr); | ||
1851 | } | ||
1852 | } | ||
1853 | |||
1854 | if (!charset) | ||
1855 | return; | ||
1856 | |||
1857 | rc = rfc2047_decode (charset, strobj_ptr (obj), &tmp); | ||
1858 | if (!rc) | ||
1859 | { | 1831 | { |
1860 | strobj_free (obj); | 1832 | strobj_free (obj); |
1861 | strobj_create (obj, tmp); | 1833 | strobj_create (obj, tmp); | ... | ... |
... | @@ -806,3 +806,36 @@ mh_set_reply_regex (const char *str) | ... | @@ -806,3 +806,36 @@ mh_set_reply_regex (const char *str) |
806 | err ? ": " : "", | 806 | err ? ": " : "", |
807 | err ? err : ""); | 807 | err ? err : ""); |
808 | } | 808 | } |
809 | |||
810 | int | ||
811 | mh_decode_2047 (char *text, char **decoded_text) | ||
812 | { | ||
813 | char *charset = mh_global_profile_get ("Charset", NULL); | ||
814 | |||
815 | if (!charset) | ||
816 | return 1; | ||
817 | if (strcasecmp (charset, "auto") == 0) | ||
818 | { | ||
819 | /* Try to deduce the charset from LC_ALL variable */ | ||
820 | |||
821 | char *tmp = getenv ("LC_ALL"); | ||
822 | if (tmp) | ||
823 | { | ||
824 | char *sp; | ||
825 | char *lang; | ||
826 | char *terr; | ||
827 | |||
828 | lang = strtok_r (tmp, "_", &sp); | ||
829 | terr = strtok_r (NULL, ".", &sp); | ||
830 | charset = strtok_r (NULL, "@", &sp); | ||
831 | |||
832 | if (!charset) | ||
833 | charset = mu_charset_lookup (lang, terr); | ||
834 | } | ||
835 | } | ||
836 | |||
837 | if (!charset) | ||
838 | return 1; | ||
839 | |||
840 | return rfc2047_decode (charset, text, decoded_text); | ||
841 | } | ... | ... |
... | @@ -408,7 +408,8 @@ static mhl_variable_t vartab[] = { | ... | @@ -408,7 +408,8 @@ static mhl_variable_t vartab[] = { |
408 | { B_NEWLINE, "newline", dt_flag }, | 408 | { B_NEWLINE, "newline", dt_flag }, |
409 | { B_ADDRFIELD, "addrfield", dt_flag }, | 409 | { B_ADDRFIELD, "addrfield", dt_flag }, |
410 | { B_DATEFIELD, "datefield", dt_flag }, | 410 | { B_DATEFIELD, "datefield", dt_flag }, |
411 | 411 | { B_DECODE, "decode", dt_flag }, | |
412 | |||
412 | /* String variables */ | 413 | /* String variables */ |
413 | { S_OVERFLOWTEXT, "overflowtext", dt_string }, | 414 | { S_OVERFLOWTEXT, "overflowtext", dt_string }, |
414 | { S_COMPONENT, "component", dt_string }, | 415 | { S_COMPONENT, "component", dt_string }, |
... | @@ -620,6 +621,12 @@ print_header_value (struct eval_env *env, char *val) | ... | @@ -620,6 +621,12 @@ print_header_value (struct eval_env *env, char *val) |
620 | val = p; | 621 | val = p; |
621 | } | 622 | } |
622 | 623 | ||
624 | if (env->bvar[B_DECODE]) | ||
625 | { | ||
626 | if (mh_decode_2047 (val, &p) == 0) | ||
627 | val = p; | ||
628 | } | ||
629 | |||
623 | if (env->bvar[B_UPPERCASE]) | 630 | if (env->bvar[B_UPPERCASE]) |
624 | { | 631 | { |
625 | for (p = val; *p; p++) | 632 | for (p = val; *p; p++) | ... | ... |
... | @@ -206,7 +206,7 @@ restore_envelope (stream_t str, struct _mhdraft_message **pmenv) | ... | @@ -206,7 +206,7 @@ restore_envelope (stream_t str, struct _mhdraft_message **pmenv) |
206 | char *env_from = NULL; | 206 | char *env_from = NULL; |
207 | char *env_date = NULL; | 207 | char *env_date = NULL; |
208 | int rc; | 208 | int rc; |
209 | char buffer[80]; | 209 | char buffer[128]; |
210 | size_t len; | 210 | size_t len; |
211 | off_t body_start, body_end; | 211 | off_t body_start, body_end; |
212 | 212 | ... | ... |
-
Please register or sign in to post a comment