Dobrodošli na FOSS Srbija

Free and Opensource Srbija je skup entuzijasta i ljubitelja slobodnog i otvorenog koda. Cilj nam je okupiti sve istomišljenike na jednom mestu i stvoriti najveći globalni OpenSource projekat u Srbiji i šire!

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CentOS Mail server

Discussion in 'Fedora, CentOS, OpenSuse' started by Marko123, 15.02.2017.

  1. Marko123

    Guest

    Da li je moguca na centos-u podignuti pravi mail server? Tacnije da imam neki svoj domen i mail i da mogu da saljem mail na google i ostale servise? Nemam staticku IP.

    Ako ne moze to, jel moze fejk server samo za localhost kao tester za web develop..
     
  2. Uzgidebas

    Korisnik

    Joined:
    09.02.2016
    Messages:
    84
    Likes Received:
    22
    Location:
    /swap
    Okruženje:
    Mate
    Sistem:
    TRIOS
    Ja bih da moze, da bih digao svoj licni mail server, umesto localhost-a... Samo ne znam kako...
     
  3. Vladimir

    Staff Member

    Joined:
    12.01.2012
    Messages:
    9,101
    Likes Received:
    3,811
    Location:
    /home
    Okruženje:
    Kde5
    Sistem:
    Arch
    Na *nix-u je sve moguće i sve može, pitanje je samo da li ti imaš vremena, strpljenja i pameti da to sve ispratiš. Ako ispuniš ta tri uslova sve možeš postići.

    Ovo je jedno od najboljih uputstava kako da se podesi mail server, ako zaista hoćeš to da radiš onda nemoj ni slučajno da propustiš neki deo, svaki deo je jednako važan kao prvi deo. Postavljanje mejl servera nije nuklearna fisija i cepanje atoma ali nije ni badava posao ako hoćeš da ga uradiš kako treba i ako hoćeš da budeš 101% siguran da će tvoj mejl biti isporučen bez problema na zadatu adresu i da će svako moći tebi da isporuči mejl na tvoju adresu.

    Čitaj i uživaj, ako imaš još pitanja slobodno pitaj Installing a fully fledged, ready to use mailserver on CentOS 6 with Postfix, PostgreSQL, Amavis, ClamAV, Spamassassin and Dovecot - Part 1 | shisaa.jp
     
    Collapse Signature Expand Signature
  4. fifajfom

    Korisnik

    Joined:
    15.02.2017
    Messages:
    1
    Likes Received:
    1
    Okruženje:
    Cinnamon
    Sistem:
    Ostalo
    Evo ja imam za ubutu kako da koristis postfix sa svojim gmail nalogom


    For this to work, we have to install several packages and configure them. We start by typing

    aptitude install postfix libsasl2 ca-certificate libsasl2-modules

    Once you have done this, postfix will ask you how you would like to configure it. You will need to select Satellite System. You will then need to put in the System Mail Name. This would be your domain name. The following page will ask you for your SMTP Host Relay. If you are using google then this will be.

    smtp.gmail.com

    Now you will need to go in to and edit the postfix configuration file. If you dont know where this is or how to edit it then you can do so by typing

    nano /etc/postfix/main.cf

    When this file opens, there are a few changes you may want to make aswell as some essential ones. If you would not like any mail to be delivered locally then you will need to change where the line starts to mydestination and remove everything after the ‘=’ so you only have localhost. You will then need to add the following lines to the bottom of the file.

    relayhost =[smtp.gmail.com]:587

    smtp_sasl_auth_enable = yes

    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

    smtp_sasl_security_options = noanonymous

    smtp_tls_CAfile =/etc/postfix/cacert.pem

    smtp_use_tls = yes

    Once you have done this, you can save and exit. The next thing we will be doing is creating the file which will be used to communicate the username and password to google to authenticate the account. to do this we need to type

    echo '[smtp.gmail.com]:587 username@gmail.com:password'>/etc/postfix/sasl_passwd

    Please note that if you are following this guide and pasting the contents in then it may replace the ‘ with a . and it may not include the tab between 587 and your username so you will need to change these manually.

    The next thing we need to do is make it so postfix can use these files and preventing other files from doing so etc. We do these by changing who can modify them with the chmod command. We will also be using the postmap command as well. Please type the following:

    chmod 400/etc/postfix/sasl_passwd

    postmap /etc/postfix/sasl_passwd

    The postmap command will map your username and password and add it to the database in an encrypted format. You can now remove this file should you wish it with the following command

    rm /etc/postfix/sasl_passwd

    The next thing we are going to do is to take care of a problem which you would experience if you were to restart postfix and try and use it as it is about not been able to authenticate. To fix this, we will need to run the following

    cat /etc/ssl/certs/Equifax_Secure_CA.pem >>/etc/postfix/cacert.pem

    Once you have done this, you should be good to go. You can now restart postfix.

    service postfix restart

    To test this we will create a php file and try and send an email using the phpmail function. To create this file, we can do the following however please make sure to change the information to your own.

    echo '<?php $to = "YourEmail@Address.com"; $subject = "Successful Email Setup Confirmation"; $message = "Woop, Emails now work from your server!"; $headers = "From: <Username@Domain.tld>\r\n"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?>'>/var/www/email.php

    If you then type in

    php /var/www/email.php

    Then your email should be sent. You can check the error logs if you have any issues if you would like to try and work them out by typing:

    nano /var/log/mail.log
     
    osx likes this.
SSL Certificate Biblioteka++ Tor anonimnost Cyberghost vyprvpn