Re: [exim] Email alias with plus addressing

Góra strony
Delete this message
Reply to this message
Autor: Terry Calie
Data:  
Dla: exim-users
Temat: Re: [exim] Email alias with plus addressing

>>>
>>>> an email is sent to reply@???. I do not plan on having a
>>>> reply mailbox defined on mydomain.com, but can do so if it's
>>>> necessary. Can someone please assist me so email can be
>>>>
>>> received at reply+*@????


Also, I use cpanel, and I just created something similar to what you
want to do. I want to be able to make dynamic addresses similar to
yours. For instance, if I buy something online from a store, I like to
give them an email in the format of <theirsite>com@???. For
example I might give circuit city circuitcitycom@???. This lets
me track where the spam is coming from and later, easily filter it out,
once it starts. So, my goal is to have a *com@???.

Anyway... here's what I created, with a slight modification to work for
you....


Look for this code in your exim configuration file (use cpanel's
advanced configuration editor):


#!!# This new router is put here to fail all domains that
#!!# were not in local_domains in the Exim 3 configuration.

fail_remote_domains:
driver = redirect
domains = ! +local_domains
allow_fail
data = :fail: unrouteable mail domain "$domain"



In the edit box just after it, put the following code (pay attention to
the single line comment):


allow_systemUsers_virtualAliases_com:
   driver = redirect
     ## below should be one long line without any newline breaks
   ${if and {{exists{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/.catchallEmails}}{exists{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/etc/$domain/shadow}}{!or 
{{match{${lookup{$local_part}lsearch{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/.catchallEmails}}}{\N.*1.*\N}}{match{${lookup{$domain}lsearch{/etc/userdomains}}}{^$local_part\$}}{match{${lookup{$local_part}lsearch{/home/${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}/etc/$domain/shadow}}}{\N.*:.*\N}}{match{$local_part}{\N.*^reply\+\N}}}}}}
     ## above should be one long line without any newline breaks
   allow_fail
   data = :fail: email address $local_part@$domain was not found. 
Please contact us via a contact form on the website - $domain
   verify_only



The code above will only act on user's domains who have a file called
.catchallEmails in their home directory. So for the domain you want to
catch the reply's, create the following file in the account home
directory (the file is the part below the dashes):

.catchallEmails:
----------------
postmaster:1
abuse:1
anyotheraddress:1


Finally, in the account WHM, create an email address called something
like, replycatchall@???, and set the default address (catchall)
using WHM to be replycatchall@???


You can add other catchall email addresses to the .catchallEmails above. 
    It's no longer a "catchall" as it now blocks anything except:


1)email addresses created in WHM
2)the account owner email address
2)email addresses (actually local parts) in the .catchallEmails file
3)your reply+* address

If you look at the code you put in the configuration file above, you'll
see {\N.*^reply\+\N} which is a regular expression to allow your
"reply+*" address to get through. Then cpanel's catchall code will do
the rest for you by routing it to your catchall address.

The account username email address and email addresses created in WHM
will work as normal. Just the addresses in the .catchallEmails file and
your repl+* address will go to your catchall address.

Let me know if you try it, as its working great for me :) I can have my
dynamic email addresses (*com@???) without allowing junk spammers
create like: lkslfjd@??? or bob@mydomain to get through.

I just created all the above because I was getting thousands of emails a
day to junk email addresses in my catchall, but I didn't want to give up
my ability to give out dynamic addresses when buying stuff and signing
up for things online.


Oh yeah, I guess if you really wanted to keep it simple, you could
solely turn on your "catchall" in WHM :) Your reply+* stuff will show
up in there. -- But watch out for the amount of junk you'll be getting
in a year, when spammers realize they can send emails to
<anything>@yourdomain.com. Like I said, I currently get about 1,000 per
day :(

Terry