Score:0

How do I forward all invalid incoming mails in exim

ph flag

I have to all my invalid incoming to new addresss I have a route like this.

virtual_aliases:
    driver = redirect
    allow_defer
    allow_fail
    domains = lsearch;/etc/userdomains
    user = "${lookup \
        {$domain} \
        lsearch{/etc/userdomains} \
        {$value} \
    }"
    group = "${lookup \
        {$domain} \
        lsearch{/etc/userdomains} \
        {$value} \
    }"
    address_data = \
        "router=$router_name \
        redirect=${quote:${lookup \
            {$local_part} \
            lsearch{${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}}}}/etc/${perl{untaint}{$domain}}/aliases} \
    }}"
    data = ${extract{redirect}{$address_data}}
    file_transport = address_file
    router_home_directory = ${extract \
        {5} \
        {::} \
        {${lookup passwd \
            {${lookup \
                {$domain_data} \
                lsearch{/etc/userdomains} \
                {$value} \
            }} \
            {$value} \
        }} \
    }
    local_part_suffix = +*
    local_part_suffix_optional
    retry_use_local_part
    unseen


userforward:
    driver = redirect
    allow_filter
    allow_fail
    forbid_filter_run
    forbid_filter_perl
    forbid_filter_lookup
    forbid_filter_readfile
    forbid_filter_readsocket
    check_ancestor
    check_local_user
    domains = $primary_hostname
    no_expn
    require_files = "+$home/.forward"
    condition = "${extract{size}{${stat:$home/.forward}}}"
    file = $home/.forward
    file_transport = address_file
    reply_transport = address_reply
    directory_transport = address_directory
    user = $local_part_data
    group = $local_part_data
    no_verify

File as user: [email protected] , user *: ::fail:Any Message

Here my normal forward works but not this * one

Score:0
ph flag

It should be like this.

catchall:
    driver = redirect
    domains = lsearch;/etc/userdomains
    address_data = \
        "router=$router_name \
        redirect=${quote:${lookup \
            {invalid_accept} \
            lsearch{${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}}}}/etc/${perl{untaint}{$domain}}/aliases} \
    }}"
    data = ${extract{redirect}{$address_data}}
    allow_fail

It is the perfect way and in a file it should be like this

invalid_accept : :fail:Whatever act you want I shown here failed act
Score:0
us flag

just use nwildlsearch instead of lsearch and put the * entry at the bottom of the file.

be MrZulf avatar
ph flag
This will work in cpanel but not here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.