Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
69 | magnus | 1 | --- a/session/draft.c |
2 | +++ b/session/draft.c |
||
3 | @@ -1399,10 +1399,12 @@ char *draft_make_msg(struct draft *draft |
||
4 | if (draft->from_address && draft->from_address[0]) { |
||
5 | from_address = draft->from_address; |
||
6 | use_sender = T; |
||
7 | - } else |
||
8 | - from_address |
||
9 | - = |
||
10 | + } else if (strchr(session->username, '@')) { |
||
11 | + from_address = pool_strdup(pool, session->username); |
||
12 | + } else { |
||
13 | + from_address = |
||
14 | pool_printf(pool, "%s@%s", session->username, default_domain); |
||
15 | + } |
||
16 | |||
17 | if (draft->from_personal && draft->from_personal[0]) { |
||
18 | from_personal = draft->from_personal; |
||
19 | @@ -1431,9 +1433,14 @@ char *draft_make_msg(struct draft *draft |
||
20 | NIL); |
||
21 | bputs(mb, "" CRLF); |
||
22 | |||
23 | - if (use_sender) |
||
24 | - bprintf(mb, "Sender: %s@%s" CRLF, session->username, |
||
25 | - default_domain); |
||
26 | + if (use_sender) { |
||
27 | + if (strchr(session->username, '@')) { |
||
28 | + bprintf(mb, "Sender: %s" CRLF, session->username); |
||
29 | + } else { |
||
30 | + bprintf(mb, "Sender: %s@%s" CRLF, session->username, |
||
31 | + default_domain); |
||
32 | + } |
||
33 | + } |
||
34 | |||
35 | if (!(draft_make_abook_address(session, mb, "To", draft->to) && |
||
36 | draft_make_abook_address(session, mb, "Cc", draft->cc) && |
||
37 | --- a/cmd/cmd_prefs.c |
||
38 | +++ b/cmd/cmd_prefs.c |
||
39 | @@ -474,9 +474,12 @@ generate_compose1_form(struct session *s |
||
40 | template_vals_string(tvals, "from_address", prefs->from_address); |
||
41 | |||
42 | if (!(prefs->from_address && prefs->from_address[0])) { |
||
43 | - char *s = pool_printf(request->pool, "%s@%s", |
||
44 | - session->username, prefs->default_domain); |
||
45 | + char *s = session->username; |
||
46 | |||
47 | + if (!strchr(session->username, '@')) { |
||
48 | + s = pool_printf(request->pool, "%s@%s", |
||
49 | + session->username, prefs->default_domain); |
||
50 | + } |
||
51 | template_vals_string(tvals, "default_from_address", s); |
||
52 | } |
||
53 |