(Warning: I’m not the big Linux sysadmin, so please take the following lines with a grain of salt!)
It always bothered me that the sendmail configuration of my root server (SuSE Linux 9.3) did not want to send mails to the outside, but instead all mails always ended up in /var/mail/(username). The following changes work for me, and maybe this is a terrible hack that can lead to nasty side effects, so all without guarantee.
First of all, you have to find out the sendmail version, which can be done with the command:
/usr/sbin/sendmail -v -d0.1 < /dev/null
Apparently, there are different solutions for different versions. Mine supposedly looked like this, in the sendmail.cf add the following line to “Smart” relay host:
DSserver.de
where DS is placed in front of the SMTP server through which you want to send mails. In addition, the following line belongs to the file /etc/mail/access (of course with your own data):
AuthInfo:server.de “U:smmsp” “I:login” “P:password”
After that, the access.db is generated:
makemap hash /etc/mail/access.db < /etc/mail/access
The first problem I had looked like this:
stat=Deferred: Connection refused by [127.0.0.1]
I then tried to establish a telnet connection on port 25 where sendmail is listening, and here I got the following error:
Trying 127.0.0.1…
telnet: connect to address 127.0.0.1: Connection refused
I was able to eliminate this error message by adding the line
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
had commented out. Normally, you don’t mess around in the sendmail.cf itself, but in the sendmail.mc, but strangely enough, it doesn’t exist on my system. After that, sendmail will be restarted:
/etc/init.d/sendmail restart
And already it works with the connection:
$penthesilea:/home/(username) #telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Unfortunately, this was not the end of my problems, so I was able to get the following error messages in alternating order:
stat=Deferred: Temporary AUTH failure
or
UTH=client, available mechanisms do not fulfill requirements
and finally also
stat=User unknown
Especially the last error message can mean anything, and only by connecting directly to the SMTP host can you see what happens. Such a connection can be created, for example, with a text file in which there is a TO: field as well as everything else, and send it as an e-mail via sendmail:
sendmail -Am -v -t < test.mail
You can already see the detailed communication between sendmail and the server, and in my case it became clear that authentication did not work. The solution was then to add an addition to the file /etc/mail/access that specifies the mechanism:
AuthInfo:server.de “U:smmsp” “I:login” “P:password” “M:LOGIN”
Now it finally works with sending mail, but I still have to solve the following problems:
- The attachments don’t really work yet, so I don’t get the database files that the WordPress plugin WP Database Backup wants to send me.
- I don’t like the sender, is currently the name of my server. You can change somewhere, but I don’t know where.
Actually, you should be able to configure such things in Yast2, but my Yast2 refuses to accept the backspace key inputs, so I can’t delete the contents of fields. No idea if this works with the Delete key on a normal keyboard?