1

Topic: mail relay

Hello,

I assume it`s possible to "relay" the email for another mail server via iRedMail ?
(email arrives to iRedMail and relay it to another mail server on the internet)

I am asking this because I need to know are those emails that are relayed to another mail server
scanned for spam and virus ? or are they just forwarder-relayed without any scanning ?

Thank You
cheers

----

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

2

Re: mail relay

You can add domain, then set it as a backup mx.

For MySQL backend, set "backupmx=1" in table "vmail.domain".
For LDAP backend, set "mailBackupMX=yes" in domain object.

3

Re: mail relay

ZhangHuangbin wrote:

You can add domain, then set it as a backup mx.

For MySQL backend, set "backupmx=1" in table "vmail.domain".
For LDAP backend, set "mailBackupMX=yes" in domain object.

Hi Zhang

In iRedAdmin-Pro-LDAP I cannot find the backupMX option... Should I set it only with phpLDAPAdmin ?
Do I have to create all the same users that are on the main server/domain, or the does it work like a ETRN queue?

Many thanks

4

Re: mail relay

ZhangHuangbin wrote:

You can add domain, then set it as a backup mx.

For MySQL backend, set "backupmx=1" in table "vmail.domain".
For LDAP backend, set "mailBackupMX=yes" in domain object.

Hello Zhang,

thank you for reply, I cannot find that option, could You please write some steps what to do ?
and are these emails that are RELAYED scanned for spam and virus BEFORE they are relayed or ??
We are talking about BACKEND domain system yes...

Thank You again
cheers

5

Re: mail relay

Albux wrote:

In iRedAdmin-Pro-LDAP I cannot find the backupMX option... Should I set it only with phpLDAPAdmin ?

Sorry, you have to change it manually with phpLDAPadmin this time, iRedAdmin-Pro doesn't manage attribute "domainBackupMX".

OviVan wrote:

are these emails that are RELAYED scanned for spam and virus BEFORE they are relayed or ??

Honestly, I didn't check this before.

6

Re: mail relay

Sorry, you have to change it manually with phpLDAPadmin this time, iRedAdmin-Pro doesn't manage attribute "domainBackupMX".

Ok, thanks.

But do I have to create also all the same accounts that are present on the main server for that domain, or does it just accept it, forward and ONLY the main server checks the recipient table?

7

Re: mail relay

ZhangHuangbin wrote:
Albux wrote:

In iRedAdmin-Pro-LDAP I cannot find the backupMX option... Should I set it only with phpLDAPAdmin ?

Sorry, you have to change it manually with phpLDAPadmin this time, iRedAdmin-Pro doesn't manage attribute "domainBackupMX".

OviVan wrote:

are these emails that are RELAYED scanned for spam and virus BEFORE they are relayed or ??

Honestly, I didn't check this before.

Do You have an option to check it on Your demo ? if You are using valid domains ?
So if we will use the backend email relay it`s enough to change the line in the database ?

For MySQL backend, set "backupmx=1" in table "vmail.domain" nothing more ?
Of course than test if the email is being scanned BEFORE relayed it would be very nice

8

Re: mail relay

Albux wrote:

But do I have to create also all the same accounts that are present on the main server for that domain, or does it just accept it, forward and ONLY the main server checks the recipient table?

It would be great if it's able to verify accounts. You should use postfix setting "relay_recipient_maps" to query accounts against backup mx server.

if you can't verify account existence, just use postfix setting "relay_domains" is enough, all mails will be relayed to backup mx.

9

Re: mail relay

ZhangHuangbin wrote:

It would be great if it's able to verify accounts. You should use postfix setting "relay_recipient_maps" to query accounts against backup mx server.

if you can't verify account existence, just use postfix setting "relay_domains" is enough, all mails will be relayed to backup mx.

Sorry Zhang, I don't quite follow you... smile

in fact it would be better if the backup server would not check the recipient table. I explain with an example:

Let's say we have a domain with two MX:

mail.example.com PRIORITY 10
mail2.example.com PRIORITY 20

on the 'master' server, example.com has all the accounts configured (which can be modified, added, removed)

if the master server fails, the messages go on the backup server 'mail2.example.com' that has the 'mailBackupMX' set to YES.

I think it would be better for the backup server to just accept messages for any account for example.com, and the check on the recipient table is done on the master server when it comes back online and the queue is flushed from the backup server.


Is it possible to replicate such a behaviour?

I used to do it with Merak with a ETRN domain for the backup, and a cron job every 5 minutes on the master server with fetchmail using protocol ETRN. So there is no need to sync the accounts on the two servers...

10

Re: mail relay

Albux wrote:

I think it would be better for the backup server to just accept messages for any account for example.com, and the check on the recipient table is done on the master server when it comes back online and the queue is flushed from the backup server.

Configure postfix setting "relay_domains =" on "mail2.example.com", and comment "relay_recipient_maps =", that's all.

11

Re: mail relay

in the iRedAdmin pro, can we configure the mail relay if we just add the new domain name and on the tab named "Relay" and form field where it standing dovecot, is it there we type the remote SMTP server address the email server we want relay to... ?

Thank You

12

Re: mail relay

here is some explanation maybe You will figure it out better than me, here is the explanation for email relay, is mail scanned before relayed to remote SMTP server....

http://blog.sekiur.com/2008/09/setting- … -centos-5/

13 (edited by OviVan 2011-04-23 07:30:35)

Re: mail relay

I really need step-by-step instruction for:

for example:
email addres: test@test.net is not located on the Postfix email server but on another SMTP mail server out there...
and the admins of this email address pointed MX record to Postfix and mail will arrive on to Postfix, now how can I configure
postfix to relay this email to remote smtp server ?? I need step-ny-step instructins.... because I don`t understand how the iredAdmin can handle this .... I see the tab RELAY but don`t know how to configure it what to type in the field: Relay/Transport Setting:  ???? now it`s standing only dovecot.... what should be here ? remote SMTP address perhaps or ??

Thank You

14

Re: mail relay

OviVan wrote:

for example:
email addres: test@test.net is not located on the Postfix email server but on another SMTP mail server out there...
and the admins of this email address pointed MX record to Postfix and mail will arrive on to Postfix, now how can I configure
postfix to relay this email to remote smtp server ?? I need step-ny-step instructins.... because I don`t understand how the iredAdmin can handle this .... I see the tab RELAY but don`t know how to configure it what to type in the field: Relay/Transport Setting:  ???? now it`s standing only dovecot.... what should be here ? remote SMTP address perhaps or ??

Since you point MX record of domain 'test.com' to iRedMail server, all mails sent to 'test.com' will arrive at iRedMail server. Let's assume test@test.com is located on server 'relay.another.com'. You can now:

- create mail domain 'test.com' with iRedAdmin-Pro
- create mail user 'test@test.com'
- Edit profile of user 'test@test.com', switch to tab 'Relay', set relay/transport to something like this:

smtp:relay.another.com:25
smtp:[relau.another.com]:25

First setting will relay mail to MX record of server 'relay.another.com', second one will relay to A record of server 'relay.another.com'.

15

Re: mail relay

Also, if you want to relay mails of whole domain, then change relay setting in domain profile page.

16

Re: mail relay

thank You Zhang, the mail relay is working now......
But however I am not sure if the email is being scannet before relayed, because I received a mail quite fast when it was sent from the hotmail....

17

Re: mail relay

OviVan wrote:

thank You Zhang, the mail relay is working now......
But however I am not sure if the email is being scannet before relayed, because I received a mail quite fast when it was sent from the hotmail....

You can check /var/log/maillog on iRedMail server, check whether amavisd process it or not. Amavisd will call SpamAssassin for anti-spam, call ClamAV for anti-virus.

18 (edited by OviVan 2011-04-23 17:53:40)

Re: mail relay

here is the last log from the server which I copied right after I sent an email which is relayed, You can see if that mail is scanned...

I just replaced orginal email addresses.... never mind for ip addresses....

Apr 23 11:45:07 mail postfix/smtpd[4401]: connect from unknown[195.18.201.20]
Apr 23 09:45:07 mail policyd: connection from: 127.0.0.1 port: 59505 slots: 0 of 2044 used
Apr 23 09:45:07 mail policyd: rcpt=11, greylist=update, host=195.18.201.20 (unknown), from=from@hotmail.com, to=xxx@test.com, size=989
Apr 23 11:45:07 mail postfix/smtpd[4401]: E9BE4C0435: client=unknown[195.18.201.20]
Apr 23 11:45:07 mail postfix/cleanup[4408]: E9BE4C0435: message-id=<F337430A-347A-44F6-98F1-A42C56D499D1@datametrix.no>
Apr 23 11:45:08 mail postfix/qmgr[3207]: E9BE4C0435: from=<from@hotmail.com>, size=1493, nrcpt=1 (queue active)
Apr 23 11:45:08 mail postfix/smtpd[4416]: connect from mail.xxx.xxx.co[127.0.0.1]
Apr 23 11:45:08 mail postfix/smtpd[4416]: D731CC0448: client=mail.xxx.xxx.co[127.0.0.1]
Apr 23 11:45:08 mail postfix/cleanup[4408]: D731CC0448: message-id=<F337430A-347A-44F6-98F1-A42C56D499D1@datametrix.no>
Apr 23 11:45:08 mail postfix/qmgr[3207]: D731CC0448: from=<from@hotmail.com>, size=1917, nrcpt=1 (queue active)
Apr 23 11:45:08 mail postfix/smtpd[4416]: disconnect from mail.xxx.xxx.co[127.0.0.1]
Apr 23 11:45:08 mail amavis[3224]: (03224-03) Passed CLEAN, LOCAL [195.18.201.20] [195.18.201.20] <from@hotmail.com> -> <xxx@test.com>, Message-ID: <F337430A-347A-44F6-98F1-A$
Apr 23 11:45:08 mail postfix/smtp[4413]: E9BE4C0435: to=<xxx@test.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=1, delays=0.09/0.01/0.01/0.88, dsn=2.0.0, status=sent (250 2.0.0 Ok, $
Apr 23 11:45:08 mail postfix/qmgr[3207]: E9BE4C0435: removed
Apr 23 11:45:09 mail postfix/smtp[4417]: D731CC0448: to=<xxx@test.com>, relay=10.48.24.15[10.48.24.15]:25, delay=0.21, delays=0.01/0.01/0.01/0.18, dsn=2.6.0, status=sent (250 2.6.0 $
Apr 23 11:45:09 mail postfix/qmgr[3207]: D731CC0448: removed
Apr 23 11:45:13 mail postfix/smtpd[4401]: disconnect from unknown[195.18.201.20]

19

Re: mail relay

OviVan wrote:

Apr 23 11:45:08 mail amavis[3224]: (03224-03) Passed CLEAN, LOCAL [195.18.201.20] [195.18.201.20] <from@hotmail.com> -> <xxx@test.com>, Message-ID: <F337430A-347A-44F6-98F1-A$

It was scanned.

20

Re: mail relay

niceeeeee smile now I am happy ! this is the way it should work on !

but is there any possibility to configure spam system to be more aggressive ?
because I receive around 9 - 10 spam emails in a day... it should be less... ?

21

Re: mail relay

You have to analytics spam mails, find why it was considered as SPAM, then tweak settings of anti-spam software to improve it.

22

Re: mail relay

thank You for reply Zhang..

>>tweak settings of anti-spam software to improve it<<  how ? which file needs to be edited ?

Have tested all the emails, everything works just as expected both local emails on the server and relayed emails....
The only small issue is how to configure spam filter to be more aggressive....

23

Re: mail relay

is this spam system "self-learned" ?

24

Re: mail relay

OviVan wrote:

is this spam system "self-learned" ?

No auto-learning by default.

I will consider improving SpamAssassin with auto-learn in the future.

25

Re: mail relay

ok, it would be nice to implement auto-learn..

You wrote:
then tweak settings of anti-spam software to improve it. .....

could you please explain me how do I configure spam-filter?