Академический Документы
Профессиональный Документы
Культура Документы
Want the 5 minute email setup guide? These steps will permit a user 'emailusername' to collect email sent to 'emailusername@yourdomain.com'. 1. 2. 3. 4. 5. 6. 7. Setup DNS with an MX record Enable POP3 on your server chkconfig saslauthd on /etc/init.d/saslauthd start adduser -shell /sbin/nologin emailusername passwd emailusername Set up your email client
And, if you want to, let a user collect more than one email address. If you want your server to collect email for domains other than the one you ordered, you'll need to setup the destinations. If you want the longer explanation of each of these steps, read on. Also, you may find this chapter from the Webmin guide useful: http://swelltech.com/support/webminguide-1.0/ch11.html.
If its not running, then get it to start at boottime. Do this via Webmin: System; Bootup and Shutdown; postfix; Start at Boottime, or via SSH: chkconfig --level 35 postfix on; /etc/init.d/postfix start. Now you will be able to send mail from your server. Try it with a command like this from your server: echo
"test" | mail -s testsubject someemail@hotmailorwherever.com
Tip: You can send a file from a Linux command line like this:
afilename=somefile.ext; (echo "$afilename is attached" ; cat $afilename | uuencode $afilename) | mail -s "`echo $afilename`" youraddress@yourserver.com
Mail Users
Now we need to configure where the mail your server receives goes... Add a Unix user. e.g. via ssh: adduser -s /sbin/nologin emailusername; passwd emailusername. The /sbin/nologin option will prevent the user from logging in to your server via, say, ssh. You could also create the user via Webmin: System; Users and Groups; Create a New User. This will be the user account that holds (stores) the emails for users until they pick them up. It does not have to match up with any of the email@ names you will be using, but it can (and will ensure that at least emailusername@yourdomain.com works).
Now you need to configure your email client to use the POP3 protocol to pick up mail from that server. In Outlook: Tools; Accounts; Add; Mail Server. Enter your name; an email address (where replies go to, enter whatever address you want - it doesn't even have to be the same domain whose emails you're picking up). Enter your mail server domain name for both the incoming (POP3) and outgoing (SMTP) servers (e.g. yourdomain.com). For Account Name, enter the username you set up, e.g. emailusername. Enter the password you set. Don't tick the "Secure Password Authentication" option (it won't work and it will stop you sending emails). At this point someone can send an email to emailusername@yourdomain.com and it should show up in your email client. Groovy.
need to.
"@yourdomain.com". In "Maps To..." use "emailusername". i.e. the user account you set up before (vs. some email address). The entries you create will end up in the /etc/postfix/virtual file. You can add values to that file directly. For example, @yourdomain.com emailusername would be added by the previous steps. If you add entries to the /etc/postfix/virtual file via SSH (not webmin) then you may also need to run postmap /etc/postfix/virtual (to create a new virtual.db file) and restart postfix. Note, that if you set up a catch-all email address, you will likely receive more unsolicited email.
If you do not get the 250-AUTH line back, make sure that saslauthd is running. You can start it up with:
/etc/init.d/saslauthd start
Running chkconfig saslauthd on will make it start up by default. Check your email client is doing SMTP authentication. For example, in Outlook go to Tools | Accounts | <your server name> | Servers tab | Outgoing Mail Server. Then check you have ticked "My Server Requires Authentication". Under the Settings... button you can just leave things as is (i.e. use the same username and password).
problems may be caused by MX records in DNS not being correct (check via nslookup). Or the Postfix Destinations may not list that email domain (in which case the email should bounce back to the sender). Send an email via your new email server to one of the email addresses you set up. Did you get it? A connection problem could be due to your mail server listening on the localhost (127.0.0.1) IP address vs. a public IP address. netstat -l will tell you what services are listening on what ports and IP addresses, * means all IP addresses. Send an email via your new email server to one of your email addresses on another server. This checks whether you can 'relay' email.
Check you have ticked the "My Server Requires Authentication" option on your Outgoing Server section (in Outlook).
If so, untick the "This server requires a secure connection (SSL)" option on the "Advanced" tab of your mail server properties.
What is the error message? "-ERR Unable to open user's INBOX"? There should be no file, or a file with that user's name in /var/spool/mail. Check the file is not actually a directory (oops!). Make sure that the file has user read/write permissions.
If you installed SquirrelMail onto a Debian server then you may need to add this alias line to your apache conf file: Alias /webmail/ "/usr/share/squirrelmail/" Now browse to http://yourip/webmail/index.php and you should be at a webmail prompt. Squirrelmail uses the server hostname in its config file and appends this to the username on outgoing email. If you have multiple domains and want each domain to append their domain name on the From address then you will need to copy the squirrelmail directory to another location (e.g. somedomain.webmail) and modify the config file. You can also modify the squirrelmail domain name by running /usr/share/squirrelmail/config/conf.pl
ISPs Filtering Port 25. AKA Resolving: The message could not be sent because connecting to SMTP server example.com failed.
This error typically occurs when your email client cannot connect to the SMTP service (e.g. sendmail or postfix) on your server. Check that sendmail is not just listening on the 127.0.0.1 address. If you followed this howto then this is likely not the problem. The more likely problem is that your ISP (or cable modem provider, DSL provider, office network admin, your home firewall, your local PC firewall, etc) is filtering out any outgoing traffic on port 25. Many ISPs (e.g. Earthlink) do this. Their goal is to try and reduce spam email by forcing people to use the ISP's email server. Some ISPs silently divert all outgoing SMTP traffic to their own SMTP server. Other ISPs will 'null route' those packets, meaning you will just not be able to connect to your server's mail service. You have a couple of options. First, you can always use your ISP's email server. It is perfectly possible to send email (with your email address) from your ISP's SMTP server. Second: you can have your mail server listen on a port other than the one your ISP is filtering. For example, port 2525. To do this run:
# in case iptables is not already installed apt-get -y install iptables # redirect traffic coming in on port 2525 to port 25 /sbin/iptables -t nat -I PREROUTING -p tcp --dport 2525 -j REDIRECT --to-port 25
# make it so that this command runs on server boot up. if ! grep -qai 2525 /etc/rc.local; then echo '/sbin/iptables -t nat -I PREROUTING -p tcp --dport 2525 -j REDIRECT --to-port 25' >> /etc/rc.local fi
Then update your email client's settings to use port 2525 rather than the default port 25 when sending email.