Ignore security checking for certain IP in MDaemon

If you’re using MDaemon Mail Server, and you would like to receive mails from some vendors that using machine generated email addresses, and these addresses are not valid email addresses, then follow this tutorial to skip security checking routines for those vendors.

But, what is an invalid email address?

An invalid email address with MDaemon is any emails come from an nonexisting domain. For example, a vendor sends you a daily report from an email [email protected]. local.machine is not a valid domain name, ever!

You could see some error messages as bellow

Sun 2012-07-01 08:30:47: <– MAIL FROM:<[email protected]> SIZE=57597
Sun 2012-07-01 08:30:47: Performing IP lookup (local.machine)
Sun 2012-07-01 08:30:47: * Error: * Name server reports domain name unknown
Sun 2012-07-01 08:30:47: —- End IP lookup results
Sun 2012-07-01 08:30:47: –> 451 <local.machine> is invalid or DNS says does not exist
Sun 2012-07-01 08:30:47: <– RSET
Sun 2012-07-01 08:30:47: –> 250 RSET? Well, ok.
Sun 2012-07-01 08:30:52: <– QUIT
Sun 2012-07-01 08:30:52: –> 221 See ya in cyberspace
Sun 2012-07-01 08:30:52: SMTP session terminated (Bytes in/out: 94/342)

The business purpose is to receive this email, then you have to ignore your ideal security requirements about validation of incoming mail from this vendor IP address. The solution is to add their incoming IP to the Trusted Hosts of MDaemon Mail Server.

How to find incoming mail server IP address?

All incoming SMTP sessions are logged in daily log file. The file names have the pattern as MDaemon-yyyymmdd-SMTP-(in).log, where yyyymmdd is year (4 digits), month (2 digits), and day (2 digits). Open the right log file, and search for the incoming email address.

For example, I found this log snippet, and found the error message too. Scroll up a little to the line Session 9501. It’s the start of this SMTP session, you will see the incoming IP at the second line. The IP address is 179.152.16.3. Don’t worry about the line #3 which has a different IP 3.16.152.179. This IP, 3.16.152.179, is just the reverse of the incoming SMTP server.

Sun 2012-07-01 08:30:52: Session 9501; child 1; thread 4664
Sun 2012-07-01 08:30:46: Accepting SMTP connection from [179.152.16.3:60666]
Sun 2012-07-01 08:30:46: Performing PTR lookup (3.16.152.179.IN-ADDR.ARPA)
Sun 2012-07-01 08:30:46: * D=3.16.152.179.IN-ADDR.ARPA TTL=(689) PTR=[179-152-16-3.static.tfn.net.us]
Sun 2012-07-01 08:30:46: * Gathering A records…
Sun 2012-07-01 08:30:46: * D=179-152-16-3.static.tfn.net.us TTL=(690) A=[179.152.16.3]
Sun 2012-07-01 08:30:46: —- End PTR results
Sun 2012-07-01 08:30:46: –> 220 mail.plaintutorials.net ESMTP MDaemon 9.6.6; Sun, 01 Jul 2012 08:30:46 -0500
Sun 2012-07-01 08:30:47: <– EHLO mx01.plaintut.com
Sun 2012-07-01 08:30:47: Performing IP lookup (mx01.plaintut.com)
Sun 2012-07-01 08:30:47: * D=mx01.plaintut.com TTL=(0) A=[179.152.16.3]
Sun 2012-07-01 08:30:47: —- End IP lookup results
Sun 2012-07-01 08:30:47: –> 250-mail.plaintutorials.net Hello 179-152-16-3.static.tfn.net.us, pleased to meet you
Sun 2012-07-01 08:30:47: –> 250-ETRN
Sun 2012-07-01 08:30:47: –> 250-AUTH=LOGIN
Sun 2012-07-01 08:30:47: –> 250-AUTH LOGIN CRAM-MD5
Sun 2012-07-01 08:30:47: –> 250-8BITMIME
Sun 2012-07-01 08:30:47: –> 250 SIZE 75000000
Sun 2012-07-01 08:30:47: <– MAIL FROM:<prvs=52278b8d3=[email protected]> SIZE=57597
Sun 2012-07-01 08:30:47: Performing IP lookup (local.machine)
Sun 2012-07-01 08:30:47: * Error: * Name server reports domain name unknown
Sun 2012-07-01 08:30:47: —- End IP lookup results
Sun 2012-07-01 08:30:47: –> 451 <local.machine> is invalid or DNS says does not exist
Sun 2012-07-01 08:30:47: <– RSET
Sun 2012-07-01 08:30:47: –> 250 RSET? Well, ok.
Sun 2012-07-01 08:30:52: <– QUIT
Sun 2012-07-01 08:30:52: –> 221 See ya in cyberspace
Sun 2012-07-01 08:30:52: SMTP session terminated (Bytes in/out: 94/342)

As the log indicated, the incoming SMTP Server IP address is 179.152.16.3. We need to add this IP address to the Trusted Host of our mail server.

How to add an IP to MDaemon Trusted Host?

These steps are for MDaemon Mail Server version 12.x

  1. In MDaemon Mail Server console, click Menu Security, and select Security Settings.MDaemon Security Settings
  2. On the left pane, select Security Settings –> Trusted Hosts. In this section, you could add IP addresses or domain names of the incoming servers.

    MDaemon Trusted Host

  3. Type in the trusted host (domain name), or IP address. You could type both in this case, or just type the incoming IP address. Please note the IP address 179.152.16.3 is collected from the log file. This is the real IP address of your vendor’s incoming IP address.

    MDaemon Trusted Host

  4. Click OK to close this dialog.

Your task is done here.

These steps are for MDaemon version 9.x

  1. Click Security menu, and select Relay / Trusts/ Tarpit / Greylist / Reverse Lookups / LAN IPs…MDaemon Trusted IP configuration
  2. The Security dialog come up, click to select tab Trusted Hosts. Add the IP, hostname (domain name) to the box, click OK.

MDaemon version 9 Trusted Host

Your task is done.

You could check the result in the log file again. The result should look like this. Please note that there is no security checking routines happened in the log.

Mon 2012-07-02 08:00:43: Session 4335; child 2; thread 2588
Mon 2012-07-02 08:00:35: Accepting SMTP connection from [179.152.16.3:4621]
Mon 2012-07-02 08:00:35: –> 220 mail.plaintutorials.net ESMTP MDaemon 9.6.6; Mon, 02 Jul 2012 08:00:35 -0500
Mon 2012-07-02 08:00:35: <– EHLO mx02.plaintut.com
Mon 2012-07-02 08:00:35: –> 250-mail.plaintutorials.net Hello mx02.plaintut.com, pleased to meet you
Mon 2012-07-02 08:00:35: –> 250-ETRN
Mon 2012-07-02 08:00:35: –> 250-AUTH=LOGIN
Mon 2012-07-02 08:00:35: –> 250-AUTH LOGIN CRAM-MD5
Mon 2012-07-02 08:00:35: –> 250-8BITMIME
Mon 2012-07-02 08:00:35: –> 250 SIZE 75000000
Mon 2012-07-02 08:00:35: <– MAIL FROM:<prvs=523fce73b=[email protected]> SIZE=60389
Mon 2012-07-02 08:00:35: –> 250 <prvs=523fce73b=[email protected]>, Sender ok
Mon 2012-07-02 08:00:35: <– RCPT TO:<[email protected]>
Mon 2012-07-02 08:00:35: –> 250 <[email protected]>, Recipient ok
Mon 2012-07-02 08:00:37: <– DATA
Mon 2012-07-02 08:00:37: Creating temp file (SMTP): c:\mdaemon\temp\md50003037242.tmp
Mon 2012-07-02 08:00:37: –> 354 Enter mail, end with <CRLF>.<CRLF>
Mon 2012-07-02 08:00:38: Message size: 60389 bytes
Mon 2012-07-02 08:00:38: Passing message through AntiVirus (Size: 60389)…
Mon 2012-07-02 08:00:38:
Mon 2012-07-02 08:00:38: —- End AntiVirus results
Mon 2012-07-02 08:00:38: Message creation successful: c:\mdaemon\inbound\md50008912538.msg
Mon 2012-07-02 08:00:38: –> 250 Ok, message saved <Message-ID: ADR37000000178967@local.machine>
Mon 2012-07-02 08:00:43: <– QUIT
Mon 2012-07-02 08:00:43: –> 221 See ya in cyberspace
Mon 2012-07-02 08:00:43: SMTP session successful (Bytes in/out: 60737/745)

Yes, there is no security checking at all.

About The Author

Hao Nguyen

Hao Nguyen

Hello! I'm Hao Nguyen and I'm currently working as a Network Engineer for a small firm in Houston. I enjoy writing technical documents and blog, such as PlanTutorials.com

Leave a Reply