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

I'm attempting to implement a consistent standard across my company's email accounts as the business grows and we also become involved with other market sectors (for which we have alternative accounts on a variation of our primary domain).

At the moment setting the sender name is tedious and decentralised, involving me setting up each account with <Firstname> <Lastname> <(Company Name)> on each PC used. However I can't account for mobile devices or machines configured by the users, as our IT infrastructure isn't running on anything like an Exchange Server - this means that one user can have several forms for their outgoing name. (Our hosting is currently configured in a VPS Xen VM running DirectAdmin on CentOS which works great for everything else. We're using the bundled Dovecot for incoming email and likewise the bundled Exim for outgoing.)

Using the "name" "(Company)" format means that there's delineation between the businesses - and more importantly only appropriate email is sent to the respective addresses (also it makes sense for recipients of emails as our addresses will be autoadded to their address book in a logical manner, instead of having what looks like several duplicates for a person where each address is valid in its own right.)

HOWEVER... I figure there must be a way to force an outgoing sender name for each account, even if it means hacking together a .conf and telling Dovecot to look to that for forcing the sender's outbound name. I'll be the first to put my hands up and say I'm absolutely clueless about the inner workings of Dovecot, I've even RTFW and I'm no closer to solving this alone.

Is what I'm trying to achieve even possible without using something like ES2K7/10? Exchange Server is a world of hurt I REALLY don't want to immerse myself into at the moment unless absolutely necessary (just setting up and actually trying to configure a test server locally has been painful enough to get the desired setup!)

share|improve this question
As Dovecot "only" handles IMAP/POP/Sieve and NOT SMTP you have to tell us which MTA (Postfix/Exim/Sendmail/...) you are using. –  Fladi Sep 16 '10 at 8:16
Ack! Sorry for not responding sooner, I got completely waylaid. The MTA is Exim 4.69. –  Christopher Woods Oct 7 '10 at 14:53
With respect, that's a rather narrow minded view. System administrators also resort to panels when they don't have sufficient time to manually administer aspects of a system. Usually they're perfectly acceptable for daily maintenance and with open codebases are easily peer reviewable and patchable. I still regularly dive into shell prompts to do advanced stuff or monitor systems, but it's hugely inefficient to be hacking the Apache and BIND confs to add a domain when it can be accomplished through a web interface. My particular question was borne out of unfamiliarity with a new software combo. –  Christopher Woods Apr 5 at 1:57
FWIW, I dropped DirectAdmin after a few years as we outgrew its capabilities. I now use OSS alongside manual configuration. –  Christopher Woods Apr 5 at 1:58

1 Answer 1

up vote 2 down vote accepted

You can do this using the rewriting capabilities of Exim. You can refer to the relevant chapter of the documentation.

share|improve this answer
You sound like you may have some experience in this area, are there any particular pitfalls to avoid in implementation? For e.g. I've just come across bashukhan.com/tag/exim-address-rewriting based on your recommendation, is this method still valid? (don't worry, I will RTFM too ;-) –  Christopher Woods Jan 25 '11 at 13:19
It's a pretty straightforward setup actually. The regex will command the rewrite, your flags will define when to apply the rewrite. As often with exim and especially if you use complex lookups, always test extensively - the ` exim` executable as a lot of useful options to test every apsect of your config. The page you're linking to is still valid, however I find it a better practice to group all rewriting rules into a rewriting section. –  François Feugeas Jan 27 '11 at 11:18
I've been doing some initial tests with multiple headers_rewrite - clearly that was never going to work, you can only declare headers_rewrite once. Bummer. –  Christopher Woods Feb 1 '11 at 16:57
Would you therefore consider regex and a rewriting section to be the best method when attempting to rewrite an entire address, including name, (e.g. from "User One" to "User One (Company Name)") for many users? I'm trying to do this for all employees in our little business, we run three companies each with their own addresses but which all receive and send mail specific to the business purpose so I wish to present as unified an approach to outbound sender names in order for recipients to distinguish them properly in their mail clients. At the moment it's all over the place w.r.t. sender names. –  Christopher Woods Feb 1 '11 at 17:03

Your Answer


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.