LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-30-2010, 06:54 AM   #1
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Rep: Reputation: 15
Help needed to permanently block access to my email server from japan


I run my own home server using OpenSuse 11.1, everything is setup using apache, php, etc etc, and it all works perfect, but now I need to use my own email server for the use of Dolphin social networking software, so that when someone registers, the email server sends out registration confirmation emails, so I set up postfix, yeah right!!!, even though I followed all instructions to set postfix as a closed relay, a test done at mxtoolbox site still said it was an open relay, but while I was trying to set up postfix, my access to the server slowed down, and my servers drive light was constantly active,,, so when I look at the mail queue, I saw 4000+ emails, all from japan, (hinen.net), so I promptly shut down postfix and use postsuper -d ALL in the command console to delete the queue, but no matter how I try, I couldn't configure postfix as a closed relay,,, so I uninstalled it and installed sendmail, and using webmin, I could use a spam list and block the domain, now, sendmail's test at mxtools show as a closed relay, I can't even send out a test email using smtp auth, but disabling auth, I can, but now my IP is blocked at spam cop, and spamhaus,,, gmail server say my IP is not authorized to send to their servers, but to use my ISP relay instead,,, but my ISP doesn't have a relay,,hence the need to run my own email server.

My home server uses double layer firewall, a hardware firewall between the internet and the server, and a software firewall on the server, and I only allow the ports I need, IE, 80 = http, 443 = https, 20/21 = ftp, 25 = smtp, 110 = pop3. and that's all, but any other internal access from my workstation to the server, using ssh, I only open the ports on the server firewall.

If someone here has a great deal of knowledge on sendmail, and can set up a an M4 (linux.mc) config file for me, it would be much appreciated.

What I would like my email server to do, is to only allow the sending of emails from inside it's own server system,, ie, when a php script sends an email to the server, then the email server would let it through, but anything else, outside the local network is ignored.

Last edited by Usalabs; 10-30-2010 at 07:07 AM.
 
Old 10-30-2010, 08:06 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
What I would like my email server to do, is to only allow the sending of emails from inside it's own server system,, ie, when a php script sends an email to the server, then the email server would let it through, but anything else, outside the local network is ignored.
You can use the accessdb to restrict relay only to localhost and your LAN. Create or edit /etc/mail/access to look like this:
Code:
127.0.0.1 RELAY
192.168.0 RELAY
assuming that your LAN is 192.168.0.0/24.
After that run:
Code:
makemap hash /etc/mail/access < /etc/mail/access
to rebuild the access database.

BTW, you can check if your mailserver is an open relay, here

Regards
 
Old 10-30-2010, 08:47 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
I can, but now my IP is blocked at spam cop, and spamhaus,,, gmail server say my IP is not authorized to send to their servers, but to use my ISP relay instead,,, but my ISP doesn't have a relay,,hence the need to run my own email server.
You can unblock your IP on their sites.
For gmail, do you have a fixed ip?
Most smtp servers won't allow mail from a dynamic IP.
You also need to setup reverse dns for the mailserver.

Kind regards

Last edited by repo; 10-30-2010 at 09:20 AM.
 
Old 10-30-2010, 09:08 AM   #4
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by repo View Post
gmail, do you have a fixed ip?
Most smtp severs won't allow mail from a dynamic IP.
You also need to setup reverse dns for the mailserver.
Unfortunately I use a dynamic IP address via dyndns.org, but my domain name I got from godaddy, and using their DNS records I forward the CName WWW to my dyndns name, thus instead of http://name.dyndns.??? the browser would use www.domainname.???, but I'm not familiar with setting up or editing a DNS MX records, or reverse DNS records, I only know about A and CNames.
 
Old 10-30-2010, 09:29 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Your outgoing mail will have the ip from your server, which is dynamic, and refused by most SMTP servers.
AFAIK you can't use dyndns for mail, unless you use their relay
http://www.dyndns.com/support/kb/outbound.html
If your provider doesn't have a mailserver, you could use the smtp from gmail.
http://www.phinesolutions.com/sendma...lay-howto.html

Kind regards
 
Old 10-31-2010, 12:27 AM   #6
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Well, trying to follow: http://www.phinesolutions.com/sendma...lay-howto.html seems to only apply to CentOS, the mc file is completely different, so if anyone wants to have a go at re-writing my linux.mc file, to use gmails smtp server, I have attached it as a text file.

It looks like a good idea to use my gmail account for an smtp relay, but what's needed are the exact 1,2,3 step instructions for OpenSuse not CentOS.

the other 2 files, I can create myself, because they would contain my gmail login information.

Before anyone asks,,,, yes I have SASL, DIGEST-MD5 CRAM-MD5 LOGIN PLAIN, all enabled and available.

I also created a self signed cert in the /etc/mail/certs location,, called sendmail.pem

It would be much appreciated if someone could mod the linux.mc file,,,, then I can just paste it into the M4 config via webmin, and recompile it myself.
Attached Files
File Type: txt sendmail-M4-Config.txt (12.8 KB, 5 views)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block a website PERMANENTLY ? Aquarius_Girl General 89 08-27-2010 11:35 PM
how to block email in email server packets Linux - Software 3 04-02-2007 03:14 PM
block extesions on email server juniox Linux - Security 1 03-07-2006 12:36 PM
Linx Email Server Setup Help needed clickaway Linux - Newbie 1 12-10-2003 02:24 PM
Email server question..badly needed.... tomtacks Linux - General 3 11-23-2001 09:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration