Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a ispconfig server, and it seems that someone is using it to send spam. I got about 130 "Mail Delivery System" email about declined send email.

This spammer uses my email address as sent from adress, so I get all these email adresses to my mail. I am using Postfix and Courier. I installed my server according to this guide: I did this a few months ago.

My question: Can I secure my server to require login to be able to send email, and if so... how?


EDIT Some data from mail.log, these kind of error show up constantly:

Jun 15 17:58:16 bolt postfix/qmgr[10712]: CC7DA1242AE: from=<paul@*****.se>, size=3782, nrcpt=1 (queue active)
Jun 15 17:58:16 bolt postfix/smtp[11337]: CC7DA1242AE: to=<>, relay=none, delay=4641, delays=4640/0.01/0.32/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for type=MX: Host not found, try again)
Jun 15 17:58:19 bolt postfix/smtpd[10836]: connect from[]
Jun 15 17:58:20 bolt postfix/smtpd[10836]: NOQUEUE: reject: RCPT from[]: 550 5.1.1 <advertising@*****.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<> to=<advertising@*****.com> proto=ESMTP helo=<>
Jun 15 17:58:20 bolt postfix/smtpd[10836]: lost connection after DATA (0 bytes) from[]
Jun 15 17:58:20 bolt postfix/smtpd[10836]: disconnect from[]
Jun 15 17:58:29 bolt postfix/smtpd[10834]: connect from unknown[]
Jun 15 17:58:32 bolt postfix/smtpd[10834]: 386791241F9: client=unknown[]
Jun 15 17:58:34 bolt postfix/cleanup[10975]: 386791241F9: message-id=<000701cc2b75$143a39f0$>
Jun 15 17:58:34 bolt postfix/qmgr[10712]: 386791241F9: from=<>, size=867, nrcpt=1 (queue active)
Jun 15 17:58:35 bolt postfix/smtpd[10834]: disconnect from unknown[]
Jun 15 17:58:35 bolt amavis[11084]: (11084-17) Blocked SPAM, [] [] <> -> <*****@*****>, Message-ID: <000701cc2b75$143a39f0$>, mail_id: XczovKoMBYNr, Hits: 18.471, size: 867, 833 ms
Jun 15 17:58:35 bolt postfix/smtp[10732]: 386791241F9: to=<*****@*****>, relay=[]:10024, delay=3.5, delays=2.7/0/0/0.83, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=11084-17 - SPAM)
Jun 15 17:58:35 bolt postfix/qmgr[10712]: 386791241F9: removed
Jun 15 17:58:43 bolt postfix/smtpd[10836]: warning: address not listed for hostname
Jun 15 17:58:43 bolt postfix/smtpd[10836]: connect from unknown[]
Jun 15 17:58:45 bolt postfix/smtpd[10727]: connect from unknown[]

EDIT #2 Got some more info from the logs, this is a send request: 15 16:41:57 bolt amavis[5399]: (05399-06) Passed CLEAN, [] [] <paul@*****.se> -> <>, Message-ID: <CHILKAT-MID-7c54ebcf-5501-de9b-f0b1-4f0234290d8d@HP-IRISH>, mail_id: 35l56Ramx6Nc, Hits: -2.941, size: 3329, queued_as: 2485770086, 136 ms 15 16:41:57 bolt postfix/smtp[4743]: 375C570082: to=<>, relay=[]:10024, delay=4.8, delays=4.7/0/0/0.14, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=05399-06, from MTA([]:10025): 250 2.0.0 Ok: queued as 2485770086)

Which apparently got thrue. Any ideas how to restrict this?

share|improve this question
up vote 1 down vote accepted

An smtp-server has to accept mails without authentication, otherwise no one would be able to send you an e-mail, because every smtp-server out there has to know a user/password for your server.

but (!), your server must not accept any mails without authentication when the desired recipient does not belong to your domain(s) (the hosts for which your smtpd should handle/receive mails) (see 'open relay'). When handling mails to recipients outside your domain(s), the sender should be authenticated.

see (/etc/postfix/)

smtpd_recipient_restrictions =

This means, you permit a delivery when the user is authenticated (here using SASL, thats the easiest way), otherwise, every other mail with a RCPT TO: not belonging to the destinations specified through mydestinations= will be rejected.

Additionally you should disable clear text login. AUTH should be only available when the connection is secure:

smtpd_tls_auth_only = yes

I doubt your postfix is an open relay, because one has to deliberately mess with the configuration to achieve this (nowadays), but you should check!

When a spammer is using your e-mail-address as a from: there's not much you can do :(

Hope this helps.

share|improve this answer
Thank you for your answer. I checked my prefs in, and found out that restrictions are set to: smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/, reject_unauth_destination As for "smtpd_tls_auth_only" it didn't exists in my conf so I added it. Just got another 45 mails. I still don't really understand how it can be possible though, its my server telling me (MAILER-DEAMON) that the email address does not exist, therefore it must be send thru my server. right? – Paul Peelen Jun 15 '11 at 15:41
The sequence of those statements in smtpd_r_r= is crucial. First: check if your server is sending any undesired mails (/var/log/mail.log). If so, stop your server. Second: Check mynetworks= and What are those maps permitting? – trurl Jun 15 '11 at 15:45
This is mynetworks: mynetworks = [::1]/128. points to a database table that is empty. There happens alot of stuff in mail.log, but from what I can see its blocking of incomming spam messages, mainly to one certain client. Can't really distinguish sending from receiving though. – Paul Peelen Jun 15 '11 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.