Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am creating a website using Ruby on Rails and I have come to the point where I am adding support for account recovery.
Using my gmail account did not work out since there was too much trouble getting the TLS stuff to work. So now I want to set up my own smtp server.
Here's the thing: it should be dead simple. I just want to use it for this webserver, no one else should be able to use it, I don't want anti-spam/virus stuff. I don't want some webbased email client. No pop, no imap. Just a dead simple way to send mails out from my server. I am running Debian Lenny, btw.
Please, help me. I am trying to Google for an answer but this is killing me. All the guides out there are just too darn complex. And they want me to install and configure a ton of packages.
Is it an ubuntu box? This link is probably the most straight forward:http://flurdy.com/docs/postfix/ Now, it looks like a lot of work, but to be honest if you follow this, it's straightforward, and should only take about an hour, maybe less if you don't get into the detail. The sticking point for most people is the DNS and MX records, but if it's only for sending out mails, such as logs and such, this should not be an issue for you. I would still throw in the antivirus stuff for sure, just to be on the safe side.
The sticking point for most people is the DNS and MX records
Luckily my DNS is handled by GoDaddy.com and besides, I do not need to handle incoming mails, just wanna send them out from my server.
Quote:
Originally Posted by irishbitte
I would still throw in the antivirus stuff for sure, just to be on the safe side.
Why should I have anti-virus when the only mails that will go through the server are those for "account recovery" and "account confirmation"? I just don't see the point. Besides I will probably block all traffic to the smtp server from anything but localhost anyway. Just to prevent it from being a spam relay.
Ok, that guide should also work with a Debian box.
Quote:
Luckily my DNS is handled by GoDaddy.com and besides, I do not need to handle incoming mails, just wanna send them out from my server.
I understand that you do not need to handle your own DNS global records, but the mail server will need to be configured to have a DNS name of some sort, or you will have unusual issues with mail not being received by recipients and so forth. So you will have to do some DNS configuration.
Quote:
Why should I have anti-virus when the only mails that will go through the server are those for "account recovery" and "account confirmation"?
The fact that you will not need to handle incoming mails, does not mean you should not have antivirus, since you do not want your reputable website to become the latest link in the chain of some script kiddy. And yes, I did read your last line:
Quote:
Just to prevent it from being a spam relay.
Besides all that, did you look through what is posted on that link? It really is quite comprehensive, and as I said in my earlier post, it does not take long to set up. Let me know how you get on.
Install postfix and during setup when prompted for the type choose "internet site"
aptitude update
aptitude install postfix
choose internet site when prompted
at that point it should be ready to send mail from your website. no further configuration should be necessary for basic operation.
There would be no domain info in the mydomains option in the postfix config so it should not accept mail for a specific domain, this is the default setting
the mynetworks option will be 127.0.0.1 so it won't relay mail from outside, it will only relay mail from the web host.
You are not receiving mail so I don't believe MX records would even be necessary for your web server. although without MX records many mail servers would reject mail from you. you could always configure postfix to use a relayhost (GoDaddys SMTP server for your domain) to avoid that issue.
There should be no need for anti-spam or anti-virus for this setup since it will not accept any mail to begin with.
Install postfix and during setup when prompted for the type choose "internet site"
aptitude update
aptitude install postfix
choose internet site when prompted
Got it! Is there a way I can verify that postfix is working? A command line to send a test mail or something?
Are there any accounts created or do I need to setup them manually?
The smtp settings in Ruby on Rails looks like this if I am correct (not sure since I haven't got it working yet):
Code:
ActionMailer::Base.smtp_settings =
{
:address => "localhost",
:port => 25,
:domain => "jovianvoid.com",
:authentication => :login, # <- or :plain, not sure what the difference is
:user_name => "myaccount",
:password => "secretpass"
}
Quote:
Originally Posted by farslayer
There would be no domain info in the mydomains option in the postfix config so it should not accept mail for a specific domain, this is the default setting
I am not following you here. "[..] accepting mail for a specific domain"?
Quote:
Originally Posted by farslayer
the mynetworks option will be 127.0.0.1 so it won't relay mail from outside, it will only relay mail from the web host.
Exactly what I want!
Quote:
Originally Posted by farslayer
You are not receiving mail so I don't believe MX records would even be necessary for your web server. although without MX records many mail servers would reject mail from you. you could always configure postfix to use a relayhost (GoDaddys SMTP server for your domain) to avoid that issue.
Here's my MX records:
$ host jovianvoid.com
jovianvoid.com has address 70.38.31.21
jovianvoid.com mail is handled by 0 smtp.secureserver.net.
jovianvoid.com mail is handled by 10 mailstore1.secureserver.net.
Is this something I should change or can I just leave it there? Not sure how changes to the MX record would impact the webmail at GoDaddy.
Quote:
Originally Posted by farslayer
There should be no need for anti-spam or anti-virus for this setup since it will not accept any mail to begin with.
I was hoping that would be the case. Just didn't know if I would risk being blacklisted if I skipped scanning my own outgoing mails from the webserver, something that seems totally unnecessary IMO.
My mistake myhostname and mydomain should be filled out.. it's mydestination you should leave as default. Nope I don't configure these every day.. so mind is a bit rusty
No there are no user accounts, since you are only looking to send mail.. you could configure accounts and secure login if you wanted, but I don't think there really is a need since it's all local to the machine.
Then if you will probably want to configure the relayhost settings
Code:
What delivery method: direct or indirect
By default, Postfix tries to deliver mail directly to the Internet. Depending on your
local conditions this may not be possible or desirable. For example, your system may
be turned off outside office hours, it may be behind a firewall, or it may be connected
via a provider who does not allow direct mail to the Internet. In those cases you
need to configure Postfix to deliver mail indirectly via a relay host.
Examples (specify only one of the following):
/etc/postfix/main.cf:
relayhost = (default: direct delivery to Internet)
relayhost = $mydomain (deliver via local mailhub)
relayhost = [mail.$mydomain] (deliver via local mailhub)
relayhost = [mail.isp.tld] (deliver via provider mailhub)
The weak spot for SPAMMING from a website is usually caused by bad code on the website itself that is vulnerable. So overall site security is what you need to focus on. If they can exploit a portion of the site to drop code onto your server, or get hte code on your server to work for them, that's when the spamming usually occurs.
No there are no user accounts, since you are only looking to send mail.. you could configure accounts and secure login if you wanted, but I don't think there really is a need since it's all local to the machine.
So if I do not need accounts, what credentials should I send to the server from the website? Or maybe I don't even need to fill out login/password to send mails?
Quote:
Originally Posted by farslayer
The weak spot for SPAMMING from a website is usually caused by bad code on the website itself that is vulnerable. So overall site security is what you need to focus on. If they can exploit a portion of the site to drop code onto your server, or get hte code on your server to work for them, that's when the spamming usually occurs.
Of course. I always try my best too keep security in mind.
EDIT:
I just tested and it worked! Great. Now I can finally have account recovery and verification.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.