FAQ 5-3

Question 5.3

How to set stuff like From, Organization, Reply-To, signature...?

Answer

There are other ways, but you should use posting styles for this. (See below why.) This example should make the syntax clear:

(setq gnus-posting-styles
  '((".*"
     (name "Frank Schmitt")
     (address "me@there.invalid")
     (organization "Hamme net, kren mer och nimmi")
     (signature-file "~/.signature")
     ("X-SampleHeader" "foobar")
     (eval (setq some-variable "Foo bar")))))

The ".*" means that this settings are the default ones (see below), valid values for the first element of the following lists are signature, signature-file, organization, address, name or body. The attribute name can also be a string. In that case, this will be used as a header name, and the value will be inserted in the headers of the article; if the value is nil, the header name will be removed. You can also say (eval (foo bar)), then the function foo will be evaluated with argument bar and the result will be thrown away.