Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a postfix/dovecot system setup on Ubuntu 10.04, and it sends/receives emails fine, but when I send emails they are all from root@mydomain.com.

For example, I have a user called "info" and when I try to send an email using mutt from this Mailbox "/home/vmail/mydomain.com/info/Maildir" the email will send find but it will be from "root@mydomain.com" and not "info@mydomain.com". I have 3 mailboxes (/home/vmail/mydomain.com/root/Maildir, /home/vmail/mydomain.com/root/postmaster, and /home/vmail/mydomain.com/root/info) and they all send and receive emails.

I am new to postfix and dovecot... can someone who knows what they are doing help me out on this one??

 30 myhostname = mail.mydomain.com
 31 alias_maps = hash:/etc/aliases
 32 alias_database = hash:/etc/aliases
 33 myorigin = mydomain.com #have tried setting myorigin = mail.mydomain.com and still same problem
 34 mydestination = mail.mydomain.com, localhost, localhost.localdomain
 35 relayhost =
 36 mynetworks = 127.0.0.0/8
 37 mailbox_size_limit = 0
 38 recipient_delimiter = +
 39 inet_interfaces = all
 40 html_directory = /usr/share/doc/postfix/html
 41 message_size_limit = 30720000
 42 virtual_alias_domains =

This is from the aliases file

 postmaster: root
 root: postmaster@mydomain.com
share|improve this question
    
What user are you logged in as when you are using Mutt? –  Ladadadada Mar 25 '12 at 20:51
    
I am logged in as root. I guess this is not an error, and just how mutt is programmed? I thought if I was in a users mailbox the from header would be for that user. –  Errol Fitzgerald Mar 25 '12 at 21:51

1 Answer 1

up vote 0 down vote accepted

You need the following two settings in your .muttrc:

realname="info"
from="info@mydomain.com"

You can also edit the headers of a message before sending by using E (that is the default on my machine, check with ?). This will open the whole message in your editor and you can fiddle with the headers to your heart's content.

UPDATE:

Sorry I should just say, if you want these settings to only be asserted when accessing certain mailboxes, you need some accounts/folder hooks. You'll need to adapt these to your situation (as these are munged from my own .muttrc for my imap access):

account-hook imaps://<dovecot domain>/ 'set imap_user="info"'
folder-hook imaps://<dovecot domain>/ 'set folder="imaps://<dovecot domain>" record="+Sent"  postponed="+Drafts" from="info@mydomain.com" realname="info"'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.