1

Topic: Two special configuration queries, multiple ips and global catchall

Hey Zhang, mostly directed at you;
Two queries,

I have two IPs, I would like mail from one domain sent from Primary IP and mail from all other domains send from the Secondary IP,
how would I go about setting this up?

The other, is there any way to set up a Global Catchall? Like postmaster@primary.domain would catch any e-mail that hit my server? Or a default domain sort of set up, so all e-mails that don't match a domain will match this default domain, and if the mailbox doesn't exist then it would use that domain's catchall?

Thanks in advance

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Two special configuration queries, multiple ips and global catchall

7t3chguy wrote:

I have two IPs, I would like mail from one domain sent from Primary IP and mail from all other domains send from the Secondary IP, how would I go about setting this up?

Try this tutorial:
http://www.iredmail.org/wiki/index.php? … IP.address

(Note: i will convert above mediawiki document to Markdown format soon.)

7t3chguy wrote:

The other, is there any way to set up a Global Catchall? Like postmaster@primary.domain would catch any e-mail that hit my server? Or a default domain sort of set up, so all e-mails that don't match a domain will match this default domain, and if the mailbox doesn't exist then it would use that domain's catchall?

A simple solution is, APPEND one more lookup table (either hash or sql, whatever you want/prefer) in Postfix parameter 'virtual_alias_maps', to query this global catchall setting. For example:

virtual_alias_maps = ..., hash:/etc/postfix/global_catchall

File /etc/postfix/global_catchall:

* catchall@domain.com

Then:

# postmap hash:/etc/postfix/global_catchall

You know that a global catchall like above will accept ALL emails (including spams) sent to non-existing mail addresses, right? you're warned.

3

Re: Two special configuration queries, multiple ips and global catchall

Another small query:
I found http://iredmail.org/docs/disable.spam.v … mails.html
but am interested in disabling Virus Scanning for outgoing e-mails only from a single domain

4

Re: Two special configuration queries, multiple ips and global catchall

Also, any reason for running Amavis on an Inet Port, instead of a Unix Socket? Surely the Unix Socket would be more efficient for this?

5

Re: Two special configuration queries, multiple ips and global catchall

and last thing, instead of specifying a default transport map, can I just set the domain-transport in iRedAdmin-Pro and link it to one I create as the wiki suggests? Or is that transport setting for receiving and not for sending?

6

Re: Two special configuration queries, multiple ips and global catchall

7t3chguy wrote:

but am interested in disabling Virus Scanning for outgoing e-mails only from a single domain

Reference: http://www200.pair.com/mecham/spam/bypassing.html

7t3chguy wrote:

Also, any reason for running Amavis on an Inet Port, instead of a Unix Socket? Surely the Unix Socket would be more efficient for this?

With a inet port, you don't need to care about file location of socket file, and you can even run Amavisd on another server.

7t3chguy wrote:

and last thing, instead of specifying a default transport map, can I just set the domain-transport in iRedAdmin-Pro and link it to one I create as the wiki suggests?

Yes. You can define transports in /etc/postfix/master.cf first, then you can set one of them with iRedAdmin-Pro (in domain profile page).

7t3chguy wrote:

Or is that transport setting for receiving and not for sending?

Currently we have only transport for receiving defined in transport_maps, but Postfix will query transports for both send/receive emails defined in transport_maps.

7

Re: Two special configuration queries, multiple ips and global catchall

If I change the transport from dovecot to my custom one, won't I have an issue receiving emails?

8

Re: Two special configuration queries, multiple ips and global catchall

7t3chguy wrote:

If I change the transport from dovecot to my custom one, won't I have an issue receiving emails?

Oh, sorry, my mistake.

*) To use a transport for SENDING email, you have to define it in Postfix parameter 'sender_dependent_default_transport_maps'. This is NOT manageable with the latest iRedAdmin-Pro release.

*) To use a transport for DELIVERING received email to local mailbox, you have to define it in Postfix parameter 'transport_maps'. This is manageable with iRedAdmin-Pro.

9

Re: Two special configuration queries, multiple ips and global catchall

Alright, so I'll just follow the wiki post, I might write it up in Markdown in a bit more of an understandable fashion to help you out

10

Re: Two special configuration queries, multiple ips and global catchall

It'll need a few tweaks but most of the content from the original MediaWiki file is there, along with instructions on the use of hash: instead of pcre: (see attachment)

11

Re: Two special configuration queries, multiple ips and global catchall

ZhangHuangbin wrote:
7t3chguy wrote:

I have two IPs, I would like mail from one domain sent from Primary IP and mail from all other domains send from the Secondary IP, how would I go about setting this up?

Try this tutorial:
http://www.iredmail.org/wiki/index.php? … IP.address

(Note: i will convert above mediawiki document to Markdown format soon.)

7t3chguy wrote:

The other, is there any way to set up a Global Catchall? Like postmaster@primary.domain would catch any e-mail that hit my server? Or a default domain sort of set up, so all e-mails that don't match a domain will match this default domain, and if the mailbox doesn't exist then it would use that domain's catchall?

A simple solution is, APPEND one more lookup table (either hash or sql, whatever you want/prefer) in Postfix parameter 'virtual_alias_maps', to query this global catchall setting. For example:

virtual_alias_maps = ..., hash:/etc/postfix/global_catchall

File /etc/postfix/global_catchall:

* catchall@domain.com

Then:

# postmap hash:/etc/postfix/global_catchall

You know that a global catchall like above will accept ALL emails (including spams) sent to non-existing mail addresses, right? you're warned.

 * email@domain.com

doesn't work, it doesn't match anything

# postalias -q hello@webdevguru.co.uk /etc/postfix/global_catchall

returns nothing

12

Re: Two special configuration queries, multiple ips and global catchall

I've used pcre:

/.*/ postmaster@example.com

instead but if there is a hash way of doing it then please let me know

13

Re: Two special configuration queries, multiple ips and global catchall

The solution I wrote in the last post had a huge issue, it meant all outgoing e-mails [leaving the server] were routed to my catchall account, I'll probably change the existing mysql query for aliases, to work only for existing domains on the server or just make changes in the sql accordingly when needed. As far as I know the IPs are working, will close this topic once that is verified

14

Re: Two special configuration queries, multiple ips and global catchall

7t3chguy wrote:

It'll need a few tweaks but most of the content from the original MediaWiki file is there, along with instructions on the use of hash: instead of pcre: (see attachment)

Document committed: http://www.iredmail.org/docs/send.out.e … esses.html

Note: i removed some code related to 'hash' table to make document clearer (let reader thinks less and finish required steps.)

15 (edited by dorpha 2015-03-10 21:50:07)

Re: Two special configuration queries, multiple ips and global catchall

Is the link broken?

16

Re: Two special configuration queries, multiple ips and global catchall

dorpha wrote:

Is the link broken?

It's now working. (it's just not yet synced when you visited that page.)