Plussed addressing in Exim

newbery

Registered
Nov 7, 2006
3
0
151
I'm trying to get a "plussed addressing" scheme set up on cPanel/Exim.

Adding...

local_part_suffix_optional
local_part_suffix = -* : +*

to the "virtual_aliases" driver in /etc/exim.conf doesn't seem to do the trick.

Any suggestions?
 

newbery

Registered
Nov 7, 2006
3
0
151
Okay... I think I figured it out.

Added these lines to the "virtual_aliases_nostar" driver instead and it seems to work.

Now, does anyone have any suggestions on how to protect or recover this configuration after a cPanel update?
 

norelidd

Well-Known Member
Jan 15, 2007
173
1
168
Vote for this bug if you want subaddressing, or plusaddressing, to be supported. I've requested it before, but haven't gotten far.

http://bugzilla.cpanel.net/show_bug.cgi?id=5292

I'd love to see a frontend made so that users could choose to make folders for different subaddresses, or even have cpanel make the folders automatically for each new subaddress it finds. I remember seeing a few lines of exim.conf settings that would do this, but beats me how it would be configured for our/cpanel's needs.
 

newbery

Registered
Nov 7, 2006
3
0
151
Thanks for the link. I'll have to study this a bit before I weigh in with my vote but I think I agree.

In any case, my usecase is slightly different than that described in the bugzilla report. Not trying to get user sub-addressing but rather the ability to allow plussed addressing in the domain email forwards. This allows for some fairly convenient throwaway addresses as an anti-spam strategy. To achieve this, I've replaced the old "virtual_aliases_nostar" driver with the following two drivers:

virtual_aliases_suffix:
driver = redirect
allow_defer
allow_fail
local_part_suffix_optional
local_part_suffix = -* : +*
data = ${if exists{/etc/valiases/$domain}{${lookup{[email protected]$domain}lsearch{/etc/valiases/$domain}}}}
file_transport = address_file
group = mail
pipe_transport = virtual_address_pipe
retry_use_local_part
domains = lsearch;/etc/localdomains

virtual_aliases_nostar:
driver = redirect
allow_defer
allow_fail
local_part_suffix_optional
local_part_suffix = -* : +*
data = ${if exists{/etc/valiases/$domain}{${lookup{[email protected]$domain}lsearch{/etc/valiases/$domain}}}}
file_transport = address_file
group = mail
pipe_transport = virtual_address_pipe
retry_use_local_part
domains = lsearch;/etc/localdomains
#unseen

So far this seems to work just fine. Now I just need to figure out how to retain this configuration after a cPanel update. Any suggestions are welcomed.
 

RyanM

Member
Mar 3, 2005
15
0
151
I have tried what newbery has suggested, but am getting errors.

I am running Exim 4.63 on WHM 10.8.0 cPanel 10.9.1-S14304 and RedHat Enterprise 3 i686 - WHM X v3.1.0. I have an alias file, mydomain.com, in /etc/valiases with the following line:
[email protected]: "|/usr/bin/php -q /home/user/bounce.php"

When emailing from Gmail, for example, I get this error back in my Gmail account:
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

[email protected]
(ultimately generated from [email protected])
No Such User Here

------ This is a copy of the message, including all the headers. ------(etc...)
Here is the lines from exim_maillog that are relavant...
2007-10-22 13:12:36 1Ik1lU-0000t1-1q <= [email protected] H=(fk-out-0910.google.com) [209.85.128.184] P=esmtp S=2038 [email protected]
2007-10-22 13:12:36 1Ik1lU-0000t1-1q ** [email protected] <[email protected]> R=virtual_aliases: No Such User Here
2007-10-22 13:12:36 1Ik1lU-0000t1-1q => |/usr/bin/php -q /home/user/bounce.php ([email protected]) <[email protected]> R=virtual_aliases_nostar T=virtual_address_pipe
2007-10-22 13:12:36 1Ik1lU-0000tC-F3 <= <> R=1Ik1lU-0000t1-1q U=mailnull P=local S=2999
2007-10-22 13:12:36 1Ik1lU-0000t1-1q Completed
2007-10-22 13:12:39 1Ik1lU-0000tC-F3 => [email protected] R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [209.85.133.114]
2007-10-22 13:12:39 1Ik1lU-0000tC-F3 Completed
The really odd thing... I know that my script, /home/user/bounce.php, is running because I see output from it on the server.

Thanks in advance for help from anyone,
Ryan