Setting 'From:' when composing

View: New views
2 Messages — Rating Filter:   Alert me  

Setting 'From:' when composing

by Maurí­cio CA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

(code quotes from git repository as of 2009/08/02)

I see in 'mail' that messages are sent with 'from' parameter as NULL:

mail/send.c, line 614:

     mu_mailer_send_message (mailer, msg, NULL, NULL);


A value for 'from' is then going to be obtained by function
'_set_from' at 'mailbox/mailer.c'. The first attempt this function
does is to get a value from message header:

mailbox/mailer.c, line 353:
     status = mu_header_aget_value (header, MU_HEADER_FROM, &mail_from);


If I read properly, the code for header_aget-like functions checks
key/value pairs in the form "Key: Value" from a given header, in
this case, key="From" (=MU_HEADER_FROM).

After that attempt, '_set_from' returns if mailer is of type
"SENDMAIL", which is not the case, as I'm using (e)smtp, and then
resorts to function 'mu_get_user_email'. That one checks a compile
time email ('mu_user_email' in mailbox/mutil.c) and then user and
host system names.

The stub provided by 'mailutils/libproto/mailer/smtp.c' for
smtp mail sending doesn't seem to further modify that value.

So, I understand (am I right?) that the only way to set a return
e-mail is to fill that 'From' key in message header. How can I do
that? I tried using '~h' in message body, but only To, Cc, Bcc and
Subject fields are available there.


Thanks for your kind attention,
Maurício



_______________________________________________
Bug-mailutils mailing list
Bug-mailutils@...
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Re: Setting 'From:' when composing

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maurí­cio CA <mauricio.antunes@...> ha escrit:

> resorts to function 'mu_get_user_email'. That one checks a compile
> time email ('mu_user_email' in mailbox/mutil.c)

It is not a compile-time email. It is settable via mu_set_user_email
call.

> So, I understand (am I right?) that the only way to set a return
> e-mail is to fill that 'From' key in message header. How can I do
> that?

Set the variable editheaders in your ~/.mailrc (or /etc/mail.rc):

   set editheaders

This will allow you to edit all headers.

Regards,
Sergey


_______________________________________________
Bug-mailutils mailing list
Bug-mailutils@...
http://lists.gnu.org/mailman/listinfo/bug-mailutils