Add subaddressing support to Exim/Dovecot

kristian

Verified User
Joined
Nov 4, 2005
Messages
440
Location
Norway
Hi,

I've been looking into how I can add mail subaddressing support working (e.g. [email protected]). It seems straight forward in itself, and I see that the /etc/exim.conf file has several occurences of this line:

Code:
.include_if_exists /etc/exim/local_part_suffix.conf

I suspect that I'll get my desired result if I, in this file, add the following two lines:

Code:
local_part_suffix = +*
local_part_suffix_optional

However, the /etc/exim/ directory does not exist on my (Debian 9) servers, so I'm wondering if this is something that is left over from something that was abandoned, or if the lack of the directory is a Debianism? I suspect the best option for me would be to create this directory, and the file in it, instead of trying to modify the /etc/exim.conf file to include it from somewhere else?

As for Dovecot, it seems that nothing special is required in its configs apart from the defaults?

Appreciate any insights. :)
 
Yeah, I have tried that, and it seems to work as expected. I was just surprised at the choice of location for this file. It seems the directory /etc/exim/ doesn't exist on any of my CentOS or Debian servers. I'm guessing it has been left as-is in order to not break any existing setups.

Thanks for your input!
 
Bonus question: Is there a way to automatically move an incoming email to a folder (if it exists) with the same name as the plus extension? I.e. if I have an imap folder named photo, and I get an email to kristian+photo@, it would automatically be delivered to the photo folder? I expect this feature would require some Dovecot configuration changes.
 
Bonus question: Is there a way to automatically move an incoming email to a folder (if it exists) with the same name as the plus extension? I.e. if I have an imap folder named photo, and I get an email to kristian+photo@, it would automatically be delivered to the photo folder? I expect this feature would require some Dovecot configuration changes.
Do you mean without using Sieve AKA Pigenhole? If you don't have sieve installed it would do it assuming is "kristian+photo@" is a real email. I know it works for "photo@"

pigeonhole - install/update pigeonhole "./build dovecot", "./build pigeonhole" or "./build all". Install pigeonhole plugin for RoundCube using: "./build roundcube". Possible values: yes/no (default: yes)

Code:
cd /usr/local/directadmin/custombuild
./build update
./build set pigeonhole yes
./build dovecot
./build roundcube
 
Last edited:
I have sieve/pigeonhole installed, but must admit I haven't looked into it that much prior to now. It looks like sieve rules is the way to go to make this happen? They would have to be global rules though, and hopefully not interfere with any rules a customer would set up.

Currently, if I send a mail to kristian+photo@, it ends up in the Inbox.
 
Yes it’s per mailbox or email.

Your customers can come use it as well. I assume some are.

it’s a great application.
 
So what I *want* is for the mail to kristian+photo@ to end up in Inbox/photo instead of just the Inbox (assuming Inbox/photo exists).

Possibly the following config in dovecot would work (no time to test right now):

Code:
lmtp_save_to_detail_mailbox=yes
recipient_delimiter=+

I suspect however, that this also would automatically create a mailfolder if one doesn't exist. I don't want that to happen.

Unless someone beats me to it, I'll try to figure this out next week.
 
So what I *want* is for the mail to kristian+photo@ to end up in Inbox/photo instead of just the Inbox (assuming Inbox/photo exists).

Possibly the following config in dovecot would work (no time to test right now):

Code:
lmtp_save_to_detail_mailbox=yes
recipient_delimiter=+

I suspect however, that this also would automatically create a mailfolder if one doesn't exist. I don't want that to happen.

Unless someone beats me to it, I'll try to figure this out next week.
Yes that is how it works

Yes you have to create the folder
It doesn’t do it for you

RoundCube has the native functionality in filters under settings

Here is a video. It will give you an idea of how to do it. Keep in mind they are doing Spam this way but the process is generally the same.

 
Last edited:
In that video, they actually create the filter though. My understanding is that it is possible to achieve this without having to manually create a filter for each name+ext@ address you want moved into a specific folder.
 
Filter is just roundcubes name for sieve rule.
You have to create something some how. It’s just an example of the process.
You can create rules in cmd line as well.
 
I most likely do not completely follow what you are trying to achieve.

I am assuming you are trying to up this ability for users that have email accounts on your server.
 
In that video, they actually create the filter though. My understanding is that it is possible to achieve this without having to manually create a filter for each name+ext@ address you want moved into a specific folder.

I know this thread is a few weeks old but I wanted to share this, which I believe details how to accomplish this:

 
Thanks for that link, I will check it out. I haven't gotten further in this project yet, there's never enough time for everything. I will update this thread with whatever I find out.
 
I realized I never updated this thread, but I talked to a few of my users, and they all said they didn't want any automatic moving of mail to detail mailboxes, so I decided not to pursue that further with dovecot/pigeonhole/sieve. If they wanted a special action taken for those mails, they would rather create their own filters for it. For now, my only config is the Exim config as described in my original post in this thread.
 
Hello good afternoon, I would like to do that, but I am tired of trying and looking for manuals, and I do not work.

You have at hand where to insert those codes, or you could provide me with how to do subaddressing, is that I have Exim4 installed.
------
Hola buenas tardes, quisiera hacer eso, pero estoy cansado de probar y buscar manuales, y no lo hago funcionar.

Tienes a mano donde hay que insertar esos códigos, o me podria facilitar como se hace subaddressing, es que yo tengo Exim4 instalado.
 
Hello good afternoon, I would like to do that, but I am tired of trying and looking for manuals, and I do not work.

You have at hand where to insert those codes, or you could provide me with how to do subaddressing, is that I have Exim4 installed.
------
Hola buenas tardes, quisiera hacer eso, pero estoy cansado de probar y buscar manuales, y no lo hago funcionar.

Tienes a mano donde hay que insertar esos códigos, o me podria facilitar como se hace subaddressing, es que yo tengo Exim4 instalado.
Did you try this? This looks like it should work:

https://www.knownhost.com/wiki/cont...w-to-configure-subaddressing-with-directadmin
 
Back
Top