I have a postfix 2.6.6 installed on a centOS 6.8, I would like to use it to send notifications of nagios, sending email in local work fine but I don't manage to send them to my email address through my domain. I have several error which I can't resolve main.cf Code: #soft_bounce = no smtpd_banner = $myhostname ESMTP $mail_name biff = no append_dot_mydomain = no readme_directory = no # Informations sur les repertoires locaux queue_directory = /var/spool/postfix #command_directory = /usr/sbin #daemon_directory = /usr/libexec/postfix mail_owner = postfix myhostname = AM004.fbr***.com mydomain = fbr***.com # POUR L'ENVOI DU COURRIER #myorigin = $myhostname myorigin = $mydomain inet_interfaces = all inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost $mydomain mynetworks = 127.0.0.0/8, 10.22.**.0/24 mynetworks_style = class relayhost = $mydomain #TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases recipient_delimiter = + mailbox_size_limit = 0 transport_maps = hash:/etc/postfix/transport #notify_classes = resource, software #virtual_alias_maps = hash:/etc/postfix/virtual Postfix logs Code: May 3 11:33:25 AM004 postfix/pickup[6613]: 71540404F6: uid=500 from=<nagios> May 3 11:33:25 AM004 postfix/cleanup[7260]: 71540404F6: message-id=<[email protected]***.com> May 3 11:33:25 AM004 postfix/qmgr[24201]: 71540404F6: from=<nagios@fbr***.com>, size=518, nrcpt=10 (queue active) May 3 11:33:25 AM004 postfix/error[30191]: 71540404F6: to=<-s@fbr***.com>, orig_to=<-s>, relay=none, delay=0.02, delays=0.01/0/0/0.01, dsn=5.1.3, status=bounced (bad address syntax) May 3 11:33:25 AM004 postfix/error[3736]: 71540404F6: to=<[email protected]>, relay=none, delay=0.02, delays=0.01/0/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to fbr***.com[10.168.0.***]:25: Connection refused) May 3 11:33:25 AM004 postfix/local[702]: 71540404F6: to=<Service@fbr***.com>, orig_to=<Service>, relay=local, delay=0.02, delays=0.01/0.01/0/0, dsn=5.1.1, status=bounced (unknown user: "service") May 3 11:33:26 AM004 postfix/local[3418]: 71540404F6: to=<sudo@fbr***.com>, orig_to=<sudo>, relay=local, delay=0.83, delays=0.01/0.01/0/0.81, dsn=5.1.1, status=bounced (unknown user: "sudo") May 3 11:33:26 AM004 postfix/local[1538]: 71540404F6: to=<is@fbr***.com>, orig_to=<is>, relay=local, delay=0.88, delays=0.01/0.01/0/0.86, dsn=5.1.1, status=bounced (unknown user: "is") May 3 11:33:26 AM004 postfix/local[6347]: 71540404F6: to=<PROBLEM@fbr***.com>, orig_to=<PROBLEM>, relay=local, delay=0.92, delays=0.01/0.01/0/0.9, dsn=5.1.1, status=bounced (unknown user: "problem") May 3 11:33:26 AM004 postfix/local[2600]: 71540404F6: to=<CRITICAL@fbr***.com>, orig_to=<CRITICAL>, relay=local, delay=1, delays=0.01/0.01/0/0.98, dsn=5.1.1, status=bounced (unknown user: "critical") May 3 11:33:26 AM004 postfix/local[32591]: 71540404F6: to=<Alert:L02ST31_IPC_Bosch/C: Espace@fbr***.com>, orig_to=<Alert:L02ST31_IPC_Bosch/C: Espace>, relay=local, delay=1.1, delays=0.01/0/0/1, dsn=5.1.1, status=bounced (unknown user: "alert:l02st31_ipc_bosch/c: espace") May 3 11:33:26 AM004 postfix/local[705]: 71540404F6: to=<disque@fbr***.com>, orig_to=<disque>, relay=local, delay=1.2, delays=0.01/0.01/0/1.2, dsn=5.1.1, status=bounced (unknown user: "disque") May 3 11:33:27 AM004 postfix/pickup[6613]: A857E43BBE: uid=500 from=<nagios> May 3 11:33:27 AM004 postfix/cleanup[5335]: A857E43BBE: message-id=<[email protected]***.com> May 3 11:33:27 AM004 postfix/qmgr[24201]: A857E43BBE: from=<nagios@fbr***.com>, size=523, nrcpt=9 (queue active) May 3 11:33:27 AM004 postfix/error[4422]: A857E43BBE: to=<-s@fbr***.com>, orig_to=<-s>, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.1.3, status=bounced (bad address syntax) May 3 11:33:27 AM004 postfix/error[3741]: A857E43BBE: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to fbr***.com[10.168.0.***]:25: Connection refused) May 3 11:33:27 AM004 postfix/local[32096]: A857E43BBE: to=<UNKNOWN@fbr***.com>, orig_to=<UNKNOWN>, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=5.1.1, status=bounced (unknown user: "unknown") May 3 11:33:27 AM004 postfix/local[3479]: 71540404F6: to=<**@fbr***.com>, orig_to=<**>, relay=local, delay=2.4, delays=0.01/0/0/2.4, dsn=5.1.1, status=bounced (unknown user: "**") May 3 11:33:27 AM004 postfix/cleanup[7260]: D5D5E43BC9: message-id=<[email protected]***.com> May 3 11:33:27 AM004 postfix/bounce[3421]: 71540404F6: sender non-delivery notification: D5D5E43BC9 May 3 11:33:27 AM004 postfix/qmgr[24201]: D5D5E43BC9: from=<>, size=4364, nrcpt=1 (queue active) May 3 11:33:27 AM004 postfix/local[32722]: D5D5E43BC9: to=<nagios@fbr***.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox) May 3 11:33:27 AM004 postfix/qmgr[24201]: D5D5E43BC9: removed May 3 11:33:28 AM004 postfix/local[5322]: A857E43BBE: to=<Alert:L15STC30.1_Panel/UPTIME@fbr***.com>, orig_to=<Alert:L15STC30.1_Panel/UPTIME>, relay=local, delay=0.81, delays=0.02/0/0/0.79, dsn=5.1.1, status=bounced (unknown user: "alert:l15stc30.1_panel/uptime") May 3 11:33:28 AM004 postfix/local[1506]: A857E43BBE: to=<**@fbr***.com>, orig_to=<**>, relay=local, delay=0.87, delays=0.02/0/0/0.85, dsn=5.1.1, status=bounced (unknown user: "**") mailq Code: DD8A943DA2 511 Wed May 3 11:50:44 nagios@fbr***.com (delivery temporarily suspended: connect to fbr***.com[10.21.***.***]:25: Connection refused) [email protected] D85AA43D6B 518 Wed May 3 11:49:19 nagios@fbr***.com (delivery temporarily suspended: connect to fbr***.com[10.21.136.***]:25: Connection refused) [email protected] DAF1B43C0C 518 Wed May 3 11:35:37 nagios@fbr***.com (delivery temporarily suspended: connect to fbr***.com[10.21.***.***]:25: Connection refused) [email protected] command.cfg Code: # 'notify-service-by-email' command definition define command{ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n $NOTIFICATIONCOMMENT$\n" | /usr/sbin/sendmail.postfix sudo -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } Any help will be welcome
The port 25 is open in my local machine and now I change the relayhost to put the smtp server of my ISP Code: relayhost = smtp.vsnl.net And there is the output of tail -f /var/log/maillog Code: May 8 10:36:21 AM004 postfix/error[18595]: 8D32243C8A: to=<nagios@fbr***.com>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to smtp.vsnl.com[203.13.40.33]:25: Connection timed out) Do you know where can come the error. Thanks
Thanks you for the link but that doesn't solve my issue have you others suggestions please. The ping is ok and there is a result of a traceroute Code: [root@AM004 ~]# traceroute -n -T -p 25 203.13.40.39 traceroute to 203.13.40.39 (203.13.40.39), 30 hops max, 60 byte packets 1 * * * 2 * * * 3 * * * 4 * * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * * 10 * * * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * *
You also have to remove the domain that you want use to send email from your destination. I think this $mydomain is what you want to use to send emails, so try removing that from mydestination.
OK I remove $mydomain in my destination but I still have the message error Code: May 9 13:20:33 AM004 postfix/error[21297]: B600B43BD6: to=<[email protected]>, relay=none, delay=0.04, delays=0.03/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to smtp.vsnl.com[203.13.40.33]:25: Connection timed out) I maybe have to reinstall postfix, I'm desperate to trying to make it work
Do this from the postfix server. telnet smtp.vsnl.com 25 Do you get the SMTP header? If not your not getting to the relay host from that machine which is what it looks like is happening.