PDA

View Full Version : Config problems, can't sendmail



chris_zebis
05-Mar-2014, 00:25
I have some scripts that I use to monitor different operations and I want to get emailed when I have problems. All of my scripts worked on other distros using exim. I have SLED now and used YaST to try to configure the mail server but I am unable to send emails. I can send local mail, but cannot send through an smtp server to reach external email addresses.

I am a little novice to SuSE, but pretty well versed in Linux. What can I do to correct this? Where do I start to look?

Thanks

mikewillis
05-Mar-2014, 13:43
When you're configuring 'Mail Server' in YaST you're configuring postfix, so you may find looking at postfix documentation helpful.

Does the setting

relayhost = the.smtp.server.you.want.to.use
appear in /etc/postfix/main.cf ?

I don't have postfix configured to use an external SMTP relay but I did try setting it up a couple of years ago out of curiosity. Like you I noticed that an email containing cronjob output or sent from command line with the mail command would get delivered to an email address that ends in the same domain as my machine's hostname, but send to an external address such as @gmail.com and it sits in the mailq along with a message saying 'host unreachable' I just looked it again quickly and found that if I specify my employer's SMTP server in the YaST configuration the setting does not get added to /etc/postfix/main.cf. If I manually add the relayhost setting to /etc/postfix/main.cf then restart postfix (service postfix restart), then do


$ date | /usr/bin/mail -s "test $(date)" -r me@mywork.net me@gmail.com

that works. The SMTP server I'm using does not require authentication so I've only looked at the relayhost setting.