| Linode Forum https://forum.linode.com/ |
|
| squeeze : basic Postfix setting https://forum.linode.com/viewtopic.php?f=11&t=8011 |
Page 1 of 1 |
| Author: | A.L [ Mon Nov 07, 2011 9:39 am ] |
| Post subject: | squeeze : basic Postfix setting |
Hi all, I followed this tutorial. http://library.linode.com/email/postfix ... -6-squeeze because i dont want email server. I just want that system will be able to send email from my linode machine ( dns are managed by Godady, for mylinode.domain.c0m And i would like to be able to redirect alls other emails for domains which are managed by linode dns like website1.c0m,website2.c0m,.. contact@mywebsite1.c0m to mywebsite1@gmail.c0m contact@mywebsite2.c0m to mywebsite2@gmail.c0m I'm a huge newbie in debian and medium in english so sometime it' rock and roll in my head So my question is very stupid, may i have to comment this block ? Quote: $remote_user = "REMOTE-USER";
$remote_host = "REMOTE-HOST"; $remote_port = "25"; $remote_ip = "127.0.0.1"; If not what is the default value for $remote_user and host ? Root and mylinode.domain.c0m ( which is actually my reverse dns in linode interface and domain that i put during the package configuration). Thank, Florent |
|
| Author: | theNADS [ Mon Nov 07, 2011 6:41 pm ] |
| Post subject: | |
Florent, Here's a few of my notes on setting up postfix to send and receive e-mails: # apt-get remove --purge exim4 # apt-get install postfix select no configuration during the install # vi /etc/postfix/main.cf add contents similar to the following and adjust the domains and ip address as required: Code:
run the newaliases command # newaliases # vi /etc/postfix/virtual add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/virtual # vi /etc/postfix/relay_recipients add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments This file should contain a complete list of the full e-mail addresses that this server will accept mail for. In order to test this set just accepts all the e-mail for each domain. When testing is complete this file should be updated (to a full list of complete e-mail addresses). Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/relay_recipients # vi /etc/postfix/transport add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments replace the xx.xx.xxx.xx ip adresses above with the ip addresses of the location that you want to transport mail to. Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/transport vi /etc/postfix/sender_access Add the following and adjust alter add and uncomment as required: Code: #Example sender access map file Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/sender_access # apt-get install sysv-rc-conf # sysv-rc-conf remove exim4 and mfs from booting in any run level add postfix to boot in levels 2,3,4 and 5 # /etc/init.d/postfix start # telnet 127.0.0.1 25 Useful commands: Watch the log as mail is sent(ctrl c - to exit) # tail -f /var/log/mail.log sync postfix files file file postfix chroot dir # LINUX2 check config # postfix check # mailq # qshape # qshape deferred # postqueue -f # postsuper -r ALL Use iptables and secure ssh etc to restrict access to the server Personally I would set your domain to use Linodes DNS servers as well. Hope this helps. jk |
|
| Author: | Piki [ Mon Nov 07, 2011 10:59 pm ] |
| Post subject: | |
theNADS wrote: Florent,
Here's a few of my notes on setting up postfix to send and receive e-mails: # apt-get remove --purge exim4 # apt-get install postfix select no configuration during the install # vi /etc/postfix/main.cf add contents similar to the following and adjust the domains and ip address as required: Code:
run the newaliases command # newaliases # vi /etc/postfix/virtual add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/virtual # vi /etc/postfix/relay_recipients add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments This file should contain a complete list of the full e-mail addresses that this server will accept mail for. In order to test this set just accepts all the e-mail for each domain. When testing is complete this file should be updated (to a full list of complete e-mail addresses). Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/relay_recipients # vi /etc/postfix/transport add these e-mail addresses to the end of this file (do not leave any white spaces at the end of the file): Code: # top of file of last line of comments replace the xx.xx.xxx.xx ip adresses above with the ip addresses of the location that you want to transport mail to. Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/transport vi /etc/postfix/sender_access Add the following and adjust alter add and uncomment as required: Code: #Example sender access map file Run the postmap command on this file whenever it is change/modified/adjusted # postmap /etc/postfix/sender_access Ehrm... Shouldn't /etc/postfix/main.cf and /etc/postfix/virtual be the only files that are needed? I have all the emails that postfix receives forwarded to my regular gmail account using /etc/postfix/virtual, I've never had to use any of the other files. /etc/aliases and the newaliases command should only be needed for routing internal emails (e.g. emails to webmaster should go to this user, emails to postmaster should go to that user). The /etc/postfix/virtual can be used to forward from users to another address, or can be used to forward email address on a domain that postfix listens for to another address. Everything else should still be relevant though. |
|
| Author: | A.L [ Tue Nov 08, 2011 6:27 am ] |
| Post subject: | |
Thanks for your help ! I appreciate. So for the moment i removed Postfix to Exim. In fact after my post, i realized that i made a mistake during the setting of Postfix. I ll try again on a new linode soon as possible when i will have more time. So my first Lamp is ready to use ! it was a big challenge for me. Regards, Florent |
|
| Author: | Piki [ Tue Nov 08, 2011 11:33 am ] |
| Post subject: | |
If you want postfix on your LAMP server, you should be able to experiment with Postfix on the same server, you just need to make sure not to touch any of your LAMP settings or programs. Using a separate machine to be safe isn't a bad idea if you're afraid you'll touch the wrong file. But if you're careful to only edit your Postfix settings and only restart Postfix, you shouldn't have to worry. |
|
| Author: | theNADS [ Tue Nov 08, 2011 6:28 pm ] |
| Post subject: | |
@PIKI If you want postfix to receive mail for a domain and then redirect it to another end destination server you need /etc/postfix/transport, as far as I understand things. I made an adjustment to my aliases file on my server and the newaliases stuff was hanging in the breeze in my notes. Anyway, I just thought I would offer a few pointers to the opening poster. Out of interest, how does the virtual file work on your setup then? # vi /etc/postfix/virtual Code: piki@piki.com piki@gmail.com jk |
|
| Author: | theNADS [ Tue Nov 08, 2011 6:47 pm ] |
| Post subject: | |
It may also be worth mentioning that I use postfix as a backup mta in case my ISP connection dies. Postfix receives mail and defers delivery for a few minutes before forwarding the any received e-mails to the server that my primary mx record points towards. The are many ways to configure postfix, but I use the relay_recipients file together with the transport file to restrict the e-mail addresses that the mail server will accept mail from. jk |
|
| Author: | Piki [ Wed Nov 09, 2011 11:21 am ] |
| Post subject: | |
theNADS wrote: @PIKI If you want postfix to receive mail for a domain and then redirect it to another end destination server you need /etc/postfix/transport, as far as I understand things. I've never used it. It doesn't even exist on my server, yet my forwarding works perfectly. I saw a /etc/postfix/relay_domains on another server I used to manage, but only one user had his own personal email setup there, but he still had his stuff in /etc/postfix/virtual along with everybody else on that server (including myself), and it still worked. theNADS wrote: I made an adjustment to my aliases file on my server and the newaliases stuff was hanging in the breeze in my notes. Right, not really necessary for this. Still useful to know about for routing emails internally on your server. theNADS wrote: Anyway, I just thought I would offer a few pointers to the opening poster. Out of interest, how does the virtual file work on your setup then? # vi /etc/postfix/virtual Code: piki@piki.com piki@gmail.com First I have a "catch all" for any domain that I don't explicitly define (e.g. if postfix receives for several domains, but I only explicitly define one in virtual): Code: piki piki@gmail.com Then, I explicitly define per domain where I want piki's messages going: Code: piki@piki.com piki@gmail.com theNADS wrote: jk
I like jk's |
|
| Author: | A.L [ Wed Nov 09, 2011 11:51 am ] |
| Post subject: | |
Piki wrote: If you want postfix on your LAMP server, you should be able to experiment with Postfix on the same server, you just need to make sure not to touch any of your LAMP settings or programs. Using a separate machine to be safe isn't a bad idea if you're afraid you'll touch the wrong file. But if you're careful to only edit your Postfix settings and only restart Postfix, you shouldn't have to worry.
I think that i will take a second linode to make others tests and to remake a full install...Thanks again. |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|