Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2585 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs
  Installation

  Postfix + roundcube sur ubuntu

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Postfix + roundcube sur ubuntu

n°977995
bartsword
Posté le 12-11-2007 à 23:06:01  profilanswer
 

Bonjour à tous,
J'essaie d'installer un serveur mail Postfix sur mon Ubuntu mais voilà... quelques soucis. Je me suis servi de plusieurs doc dont je vous fait part:
 - http://www.linux-france.org/articl [...] aco/#N3121
 - http://doc.ubuntu-fr.org/postfix
 - http://doc.ubuntu-fr.org/serveur/mail
 - http://www.starbridge.org/spip/spip.php?article12
 
Alors déjà la reception des mails fonctionne parfaitement. De n'importe quel boîte mail, qu'elle soit local ou externe, je peux donc accéder à mon courrier reçu via le client webmail Roundcube. Je peux aussi envoyer des mails via la ligne de commande, mais seulement en local. Et alors dès que j'essaie d'envoyer un mail depuis RoundCube il me met un message d'erreur : "L'envoi du message à échoué".
 
Voilà, je ne sais plus quoi faire pour pouvoir envoyer des messages à l'extérieur de mon réseau et depuis mon webmail.
Je vous post aussi le shéma de mon réseau, et les différents fichiers de configurations des applis.
 
envoi d'un mail :
http://img252.imageshack.us/img252 [...] re2wc3.png
je reçois bien les mails, avec @localhost et @neofx.zapto.org qui est mon nom de domaine.
 
Shéma de mon réseau:
http://img404.imageshack.us/img404 [...] 001gu2.jpg
les ports sont bien configuré sur mon firewall.  
 
Postfix  
      /etc/postfix/main.cf

Code :
  1. # See /usr/share/postfix/main.cf.dist for a commented, more complete version
  2. #
  3. #
  4. # Debian specific:  Specifying a file name will cause the first
  5. # line of that file to be used as the name.  The Debian default
  6. # is /etc/mailname.
  7. #myorigin = /etc/mailname
  8. #
  9. smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  10. biff = no
  11. #
  12. # appending .domain is the MUA's job.
  13. append_dot_mydomain = no
  14. #
  15. # Uncomment the next line to generate "delayed mail" warnings
  16. #delay_warning_time = 4h
  17. #
  18. # TLS parameters
  19. smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
  20. smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
  21. smtpd_use_tls=yes
  22. smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
  23. smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
  24. #
  25. # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  26. # information on enabling SSL in the smtp client.
  27. #
  28. myhostname = mail.neofx.zapto.org
  29. alias_maps = hash:/etc/aliases
  30. alias_database = hash:/etc/aliases
  31. myorigin = /etc/mailname
  32. mydestination = neofx.zapto.org, kyle.neofx.zapto.org, localhost.neofx.zapto.org, localhost
  33. relayhost =
  34. mynetworks = 127.0.0.0/8, 192.168.0.0/24
  35. #mailbox_command = procmail -a "$EXTENSION"
  36. mailbox_size_limit = 0
  37. recipient_delimiter = +
  38. inet_interfaces = all
  39. home_mailbox = Maildir/


 
 
RoundCube
        /var/www/roundcube/config/main.inc.php

Code :
  1. <?php
  2. /*
  3. +-----------------------------------------------------------------------+
  4. | Main configuration file                                               |
  5. |                                                                       |
  6. | This file is part of the RoundCube Webmail client                     |
  7. | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  8. | Licensed under the GNU GPL                                            |
  9. |                                                                       |
  10. +-----------------------------------------------------------------------+
  11. */
  12. $rcmail_config = array();
  13. // system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
  14. $rcmail_config['debug_level'] = 1;
  15. // enable caching of messages and mailbox data in the local database.
  16. // this is recommended if the IMAP server does not run on the same machine
  17. $rcmail_config['enable_caching'] = TRUE;
  18. // lifetime of message cache
  19. // possible units: s, m, h, d, w
  20. $rcmail_config['message_cache_lifetime'] = '10d';
  21. // automatically create a new RoundCube user when log-in the first time.
  22. // a new user will be created once the IMAP login succeeds.
  23. // set to false if only registered users can use this service
  24. $rcmail_config['auto_create_user'] = FALSE;
  25. //chang, avant c'était TRUE
  26. // the mail host chosen to perform the log-in
  27. // leave blank to show a textbox at login, give a list of hosts
  28. // to display a pulldown menu or set one host as string.
  29. // To use SSL connection, enter ssl://hostname:993
  30. $rcmail_config['default_host'] = 'localhost';
  31. //changé, avant c'était localhost
  32. // TCP port used for IMAP connections
  33. $rcmail_config['default_port'] = 143;
  34. // Automatically add this domain to user names for login
  35. // Only for IMAP servers that require full e-mail addresses for login
  36. // Specify an array with 'host' => 'domain' values to support multiple hosts
  37. $rcmail_config['username_domain'] = '';
  38. // This domain will be used to form e-mail addresses of new users
  39. // Specify an array with 'host' => 'domain' values to support multiple hosts
  40. $rcmail_config['mail_domain'] = '';
  41. // Path to a virtuser table file to resolve user names and e-mail addresses
  42. $rcmail_config['virtuser_file'] = '';
  43. // Query to resolve user names and e-mail addresses from the database
  44. // %u will be replaced with the current username for login.
  45. // The query should select the user's e-mail address as first col
  46. $rcmail_config['virtuser_query'] = '';
  47. // use this host for sending mails.
  48. // to use SSL connection, set ssl://smtp.host.com
  49. // if left blank, the PHP mail() function is used
  50. $rcmail_config['smtp_server'] = 'localhost';
  51. //changé, avant c'était localhost
  52. // SMTP port (default is 25; 465 for SSL)
  53. $rcmail_config['smtp_port'] = 25;
  54. // SMTP username (if required) if you use %u as the username RoundCube
  55. // will use the current username for login
  56. $rcmail_config['smtp_user'] = '%u';
  57. // SMTP password (if required) if you use %p as the password RoundCube
  58. // will use the current user's password for login
  59. $rcmail_config['smtp_pass'] = '%p';
  60. // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
  61. // best server supported one)
  62. $rcmail_config['smtp_auth_type'] = 'LOGIN';
  63. // SMTP HELO host  
  64. // Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages  
  65. // Leave this blank and you will get the server variable 'server_name' or  
  66. // localhost if that isn't defined.  
  67. $rcmail_config['smtp_helo_host'] = '';
  68. // Log sent messages
  69. $rcmail_config['smtp_log'] = TRUE;
  70. // these cols are shown in the message list
  71. // available cols are: subject, from, to, cc, replyto, date, size, encoding
  72. $rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size');
  73. // relative path to the skin folder
  74. $rcmail_config['skin_path'] = 'skins/default/';
  75. // includes should be interpreted as PHP files
  76. $rcmail_config['skin_include_php'] = FALSE;
  77. // use this folder to store temp files (must be writebale for apache user)
  78. $rcmail_config['temp_dir'] = 'temp/';
  79. // use this folder to store log files (must be writebale for apache user)
  80. $rcmail_config['log_dir'] = 'logs/';
  81. // session lifetime in minutes
  82. $rcmail_config['session_lifetime'] = 10;
  83. // check client IP in session athorization
  84. $rcmail_config['ip_check'] = false;
  85. // Use an additional frequently changing cookie to athenticate user sessions.
  86. // There have been problems reported with this feature.
  87. $rcmail_config['double_auth'] = false;
  88. // this key is used to encrypt the users imap password which is stored
  89. // in the session record (and the client cookie if remember password is enabled).
  90. // please provide a string of exactly 24 chars.
  91. $rcmail_config['des_key'] = 'CeQueTuVeux-En-24Lettres';
  92. // the default locale setting
  93. $rcmail_config['locale_string'] = 'fr';
  94. // use this format for short date display
  95. $rcmail_config['date_short'] = 'D H:i';
  96. // use this format for detailed date/time formatting
  97. $rcmail_config['date_long'] = 'd.m.Y H:i';
  98. // use this format for today's date display
  99. $rcmail_config['date_today'] = 'H:i';
  100. // add this user-agent to message headers when sending
  101. $rcmail_config['useragent'] = 'RoundCube Webmail/0.1b';
  102. // use this name to compose page titles
  103. $rcmail_config['product_name'] = 'RoundCube Webmail';
  104. // only list folders within this path
  105. $rcmail_config['imap_root'] = '';
  106. // store draft message is this mailbox
  107. // leave blank if draft messages should not be stored
  108. $rcmail_config['drafts_mbox'] = 'Drafts';
  109. // store spam messages in this mailbox
  110. $rcmail_config['junk_mbox'] = 'Junk';
  111. // store sent message is this mailbox
  112. // leave blank if sent messages should not be stored
  113. $rcmail_config['sent_mbox'] = 'Sent';
  114. // move messages to this folder when deleting them
  115. // leave blank if they should be deleted directly
  116. $rcmail_config['trash_mbox'] = 'Trash';
  117. // display these folders separately in the mailbox list.
  118. // these folders will automatically be created if they do not exist
  119. $rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
  120. // protect the default folders from renames, deletes, and subscription changes
  121. $rcmail_config['protect_default_folders'] = TRUE;
  122. // Set TRUE if deleted messages should not be displayed
  123. // This will make the application run slower
  124. $rcmail_config['skip_deleted'] = FALSE;
  125. // Set true to Mark deleted messages as read as well as deleted
  126. // False means that a message's read status is not affected by marking it as deleted
  127. $rcmail_config['read_when_deleted'] = TRUE;
  128. // When a Trash folder is not present and a message is deleted, flag  
  129. // the message for deletion rather than deleting it immediately.  Setting this to  
  130. // false causes deleted messages to be permanantly removed if there is no Trash folder
  131. $rcmail_config['flag_for_deletion'] = TRUE;
  132. // Make use of the built-in spell checker. It is based on GoogieSpell.
  133. // Since Google only accepts connections over https your PHP installatation
  134. // requires to be compiled with Open SSL support
  135. $rcmail_config['enable_spellcheck'] = TRUE;
  136. // For a locally installed Nox Spell Server, please specify the URI to call it.
  137. // Get Nox Spell Server from http://orangoo.com/labs/?page_id=72
  138. // Leave empty to use the Google spell checking service, what means
  139. // that the message content will be sent to Google in order to check spelling
  140. $rcmail_config['spellcheck_uri'] = '';
  141. // These languages can be selected for spell checking.
  142. // Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch');
  143. // Leave empty for default set of Google spell check languages
  144. $rcmail_config['spellcheck_languages'] = array('en'=>'English', 'fr'=>'Français');
  145. // path to a text file which will be added to each sent message
  146. // paths are relative to the RoundCube root folder
  147. $rcmail_config['generic_message_footer'] = '';
  148. // this string is used as a delimiter for message headers when sending
  149. // leave empty for auto-detection
  150. $rcmail_config['mail_header_delimiter'] = NULL;
  151. // in order to enable public ldap search, create a config array
  152. // like the Verisign example below. if you would like to test,  
  153. // simply uncomment the Verisign example.
  154. /**  
  155. * example config for Verisign directory
  156. *
  157. * $rcmail_config['ldap_public']['Verisign'] = array(
  158. *  'name'          => 'Verisign.com',
  159. *  'hosts'         => array('directory.verisign.com'),
  160. *  'port'          => 389,
  161. *  'base_dn'       => '',
  162. *  'bind_dn'       => '',
  163. *  'bind_pass'     => '',
  164. *  'ldap_version'  => 3,       // using LDAPv3
  165. *  'search_fields' => array('mail', 'cn'),  // fields to search in
  166. *  'name_field'    => 'cn',    // this field represents the contact's name
  167. *  'email_field'   => 'mail',  // this field represents the contact's e-mail
  168. *  'surname_field' => 'sn',    // this field represents the contact's last name
  169. *  'firstname_field' => 'gn',  // this field represents the contact's first name
  170. *  'scope'         => 'sub',   // search mode: sub|base|list
  171. *  'filter'        => '',      // used for basic listing (if not empty) and will be &'d with search queries. ex: (status=act)
  172. *  'fuzzy_search'  => true);   // server allows wildcard search
  173. */
  174. // don't allow these settings to be overriden by the user
  175. $rcmail_config['dont_override'] = array();
  176. // list of configuration option names that need to be available in Javascript.
  177. $rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion');
  178. // try to load host-specific configuration
  179. $rcmail_config['include_host_config'] = FALSE;
  180. /***** these settings can be overwritten by user's preferences *****/
  181. // show up to X items in list view
  182. $rcmail_config['pagesize'] = 40;
  183. // use this timezone to display date/time
  184. $rcmail_config['timezone'] = intval(date('O'))/100 - date('I');
  185. // is daylight saving On?
  186. $rcmail_config['dst_active'] = (bool)date('I');
  187. // prefer displaying HTML messages
  188. $rcmail_config['prefer_html'] = TRUE;
  189. // compose html formatted messages by default
  190. $rcmail_config['htmleditor'] = TRUE;
  191. // show pretty dates as standard
  192. $rcmail_config['prettydate'] = TRUE;
  193. // default sort col
  194. $rcmail_config['message_sort_col'] = 'date';
  195. // default sort order
  196. $rcmail_config['message_sort_order'] = 'DESC';
  197. // save compose message every 300 seconds (5min)
  198. $rcmail_config['draft_autosave'] = 300;
  199. // default setting if preview pane is enabled
  200. $rcmail_config['preview_pane'] = FALSE;
  201. // don't let users set pagesize to more than this value if set
  202. $rcmail_config['max_pagesize'] = 200;
  203. // end of config file
  204. ?>


 
 
Voilà je vous ai mis à peu près tout le travail que j'ai fait. J'espere obtenir une réponse ici, je vous rappelle le probleme pour conclure: J'arrive à recevoir sur le webmail de n'importe où mais je n'arrive à envoyer ET que en local depuis la ligne de commande.
 
Je vous remercie d'avance.
 
+
 
 [:masekelah]  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


---------------
_____________________________
mood
Publicité
Posté le 12-11-2007 à 23:06:01  profilanswer
 

n°978017
toniotonio
Posté le 13-11-2007 à 07:16:35  profilanswer
 

que disent les logs de postfix lors de l'envoi ?


---------------
Messagerie dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com
n°978168
bartsword
Posté le 13-11-2007 à 13:12:20  profilanswer
 

Je sais pas mais j'ai réussi à résoudre le problème en ne mettant rien à la ligne 65 du fichier de config de roundcube /var/www/roundcube/config/main.inc.php
 
De cette façon roundcube utilise la fonction mail() de php. Mais est-ce une bonne solution ?


---------------
_____________________________
n°978173
toniotonio
Posté le 13-11-2007 à 13:22:47  profilanswer
 

la plupart du temps oui
 
cela depend des configs.


---------------
Messagerie dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com
n°978330
bartsword
Posté le 13-11-2007 à 15:42:39  profilanswer
 

Merci tonio.
 
Maintenant ce que j'aimerais faire c'est sécuriser le tout pour pas qu'on utilise mon serveur mail comme relai ouvert si tu vois ce que je veux dire... comment faire ?


---------------
_____________________________
n°978341
toniotonio
Posté le 13-11-2007 à 16:01:47  profilanswer
 

par défaut postfix n'est pas un openrelay.
c'est pour cela qu'il faut etre prudent avec les options dans le main.cf.
 
poste un postconf -n


---------------
Messagerie dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com
n°978385
bartsword
Posté le 13-11-2007 à 16:51:23  profilanswer
 

Code :
  1. alias_database = hash:/etc/aliases
  2. alias_maps = hash:/etc/aliases
  3. append_dot_mydomain = no
  4. biff = no
  5. config_directory = /etc/postfix
  6. home_mailbox = Maildir/
  7. inet_interfaces = all
  8. mailbox_size_limit = 0
  9. mydestination = neofx.zapto.org, kyle.neofx.zapto.org, localhost.neofx.zapto.org, localhost
  10. myhostname = mail.neofx.zapto.org
  11. mynetworks = 127.0.0.0/8, 192.168.0.0/24
  12. myorigin = /etc/mailname
  13. recipient_delimiter = +
  14. relayhost =
  15. smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
  16. smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  17. smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
  18. smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
  19. smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
  20. smtpd_use_tls = yes


Message édité par bartsword le 13-11-2007 à 16:51:41

---------------
_____________________________
n°978406
toniotonio
Posté le 13-11-2007 à 17:37:19  profilanswer
 

ca semble correct
seul le 192.168.0.0/24 peut relayer  


---------------
Messagerie dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com
n°978468
bartsword
Posté le 13-11-2007 à 22:07:30  profilanswer
 

ok merci de ton aide  
a+


---------------
_____________________________

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs
  Installation

  Postfix + roundcube sur ubuntu

 

Sujets relatifs
Problème freeze avec ubuntu[RESOLU] UBUNTU install ADSL
Interet d'ubuntu via vista et XP ?[RESOLU][Postfix & Exchange][SMTP relay & Recipients]
PB install Netgear GA311 sous UBUNTU[Postfix][Spamassassin]
SMTP Authentification - Postfix - Certificatprobleme de son ubuntu
MultiBoot Vista/Ubuntu/Mandriva[RESOLU] Neogia sous linux Ubuntu ?
Plus de sujets relatifs à : Postfix + roundcube sur ubuntu


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR