Unknown mail transport error postfix

Email errors are a nuisance for server owners. Here, we'll see the four main reasons for "unknown mail transport error" in Postfix servers and how we fix it

Emails are vital for online businesses. That’s why email errors are a nuisance for server owners.

At Bobcares, we often resolve many such email errors as a part of our Technical Support Services for web hosting companies.

Today, we’ll see what causes “unknown mail transport error” in servers and how we fix them.

What causes “unknown mail transport error” in servers

Postfix is a commonly used mail server in Linux servers. Many control panels like Plesk offers Postfix mail server as part of its installation.

Postfix can also be integrated with third party mail server providers such as SendGrid. But at times, Postfix can throw errors during mail delivery.

One such issue is when server owners report of mail delivery errors. We examine the mail logs and notice a lot of undelivered outgoing emails in the mail queue.

The mail logs at /var/log/maillog often show these errors:

postfix/error[12027]: 541B4649412: to=, relay=none, delay=113711, delays=193632/1/0/0.01, status=deferred (unknown mail transport error)

The major causes for this error are:

1. Postfix configuration issues

The main configuration file of Postfix is /etc/postfix/main.cf. This file contains the default Postfix settings such as transport settings, network, mail server IP and so on.

In cases of external mail server or other special requirement, custom settings have to be done in this configuration file. This include adding IPs that can relay through the server.

Any wrong entries in this configuration file can lead to errors in email delivery, such as  “unknown mail transport error”. Software updates or patches can also corrupt Postfix installation and cause errors.

2. File permissions

The mail queue, configuration file, filters and mail folders, all these need to have proper ownership and permissions for mail delivery to work fine.

Usernames and passwords are saved in the file /etc/postfix/sasl_passwd. This file should be readable by Postfix service and need to have proper ownership and permissions.

After adding entries to the password file, it should be mapped to a database file in postfix. The database and other related files should have the right access privileges.

3. Missing aliases

Email aliases usually refers to forwarders to various email accounts. It can happen that sometimes the aliases contain non-existent or invalid email accounts, giving out errors in email delivery.

4. Third party integration

Postfix can be integrated with third party mail servers like SendGrid, Mandrill, etc. For mails to relay through their servers, custom configuration has to be done in Postfix.

In some installations of Postfix, only alphanumeric passwords are allowed. If the SendGrid password is not in that format or there are any configuration mistakes, mail server will throw errors.

How to fix “unknown mail transport error” in Postfix servers

1. Fix configuration errors

The major reason for “unknown mail transport error” is the error in configuration file. We figure out the erroneous entries and correct them.

In cases where the Postfix configuration is corrupt, we rebuild the configuration files and repair the Postfix installation and confirm that mails are working fine.

2. Examine email aliases

If the error is specific to only specific email addresses or aliases, we examine those aliases and figure out the missing accounts. We update these aliases for the mails to work fine.

3. Permission and ownership updates

We cross-check the permissions and ownership of the related files and folders and update them so that Postfix service can access them and deliver mails without errors.

4. Reinstall Postfix

In cases where the error occurred after any software or package updates, we pinpoint the module or patch that caused the issue. We reinstall or reconfigure those to ensure successful mail functioning.

In the servers we manage, we conduct periodic server audits to confirm the success of software updates and functioning of services. For the upgrades we perform, we take actions to avoid such issues.

Conclusion

Email errors can be vexing for server owners. Today, we saw how our Outsourced Tech Support team easily fix the error ‘unknown mail transport error’ for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

Postfix is used commonly in Linux servers as the default mail server. Also in control panels like Plesk, you’re going to find Postfix installed in it. Just like other services, it is susceptible to errors. There are many errors users and admins can come across. And one of them is the ‘unknown mail transport error’. Its the server owners who get this error when sending emails. If you navigate into the mail logs at /var/log/maillog:

Code:

postfix/error[12027]: 541B4649412: to=<user@email.com>, relay=none, delay=113711, delays=193632/1/0/0.01, status=deferred (unknown mail transport error)

In this article, learn why this error occurs and some of the ways to fix it.

4 Reasons Behind the unknown mail transport error

There are four reasons why this error may occur. Those are:

  • Configuration issues in Postfix

Postfix has a configuration file at /etc/postfix/main.cf. It contains a wide range of settings for transport settings, network, mail server IP, among others.

If the mail server you’re sending emails to is external, you need to apply custom settings in the configuration file. Among other things, you’d have to add IP addresses that can relay through the server.

When making the changes, you need to be careful. Any incorrect information in this file will lead to ‘unknown mail transport error.’ In some cases, software updates and patching also make changes to the configuration files. This leads to the transport error in some cases.

  • Incorrect file permissions

For an email to be delivered successfully, its important that the correct ownership and permission are set for mail queue, filters, configuration file, and mail folders.

You can access usernames and their respective passwords at /etc/postfix/sasl_passwd. You need to make sure that you’ve set up adequate ownership and permissions that the Postfix services needs. Also, you’d have to add entries to the password file and map them to a database file in postfix. The database, too, should have required privileges.

  • Aliases missing

Email aliases are essentially the forwards to other email accounts. In some cases, the alias may contain invalid email accounts or accounts that don’t exist. So you’re likely to face errors in email delivery.

  • Incorrect third party integration

You can integrate Postfix with third-party services like SendGrid. But for the emails to be successfully relay through their servers, you must apply custom configuration correctly.

In some versions of Postfix, you’re limited to using alphanumeric passwords. In case the SendGrid doesn’t have the same format, you’re likely to run into this error.

Fixing the Error

There are a few ways you can fix the error. And it starts with recognizing the core issue. Here are the solutions:

  • Fix configuration errors

The primary reason for this error is misconfiguration. Therefore, you need to fix the configuration errors at the config file. Figure out the erroneous entries and fix them.

If the configuration file is corrupted, you need to rebuild it and repair Postfix installation. This should fix the error.

  • Check the email aliases

If email aliases are missing or email accounts doesn’t exist, then you need to update the alises to fix the issue.

  • Update permission and ownership

To ensure Postfix service is able to access required files and folder, you need to update the permission and ownership details.

  • Reinstall Postfix

Lastly, you can reinstall Postfix if the error resulted from a software or package update. Or, you can also update/restore specific module or patch that might be causing the error.

So that’s how you deal with the ‘unknown mail transport error’. Its a relay error that affects mail delivery. For more assistance, contact the support team.

I have configured postfix similar to this one: «Recipient address rejected» when sending an email with sendgrid

$ /etc/postfix/main.cf

smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = static:username:password
smtp_sasl_security_options = noanonymous 
smtp_tls_security_level = may 
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net:587]

But I keep getting such errors:

Feb 3 22:57:29 vsempprdapp11 postfix/error[24019]: 327A4441481: to=<DistU_MyAdmin@bratgroup.com>, relay=none, delay=193633, delays=193632/1/0/0.01, dsn=4.3.0, status=deferred (unknown mail transport error) 

netstat shows I have port 25 listening

/var/www/app: netstat -an | grep :25
tcp        0      0 0.0.0.0:25              0.0.0.0:*
LISTEN     
tcp6       0      0 :::25                   :::*
LISTEN     
udp6       0      0 fe80::250:56ff:fe96:123 :::* 

my postconf


Another interesting thing is, if I change my main.cf to following it works for non-domain emails-ids(email addresses other than @bratgroup.com like @gmail.com, @hotmail.com emails get delivered). And for @bratgroup.com mail.log says connection timed out

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
myorigin = mybrat.bratgroup.com
mydomain = mybrat.bratgroup.com
myhostname = mybrat.bratgroup.com
mydestination = localhost.$mydomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
message_size_limit = 27852800
append_dot_mydomain = no
biff = no
readme_directory = no
#delay_warning_time = 4h

# TLS parameters
smtpd_use_tls=yes
smtpd_tls_cert_file=/etc/apache2/ssl/mybrat.bratgroup.com/site.crt
smtpd_tls_key_file=/etc/apache2/ssl/mybrat.bratgroup.com/site.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# opportunistic encryption, as a client
smtp_tls_security_level = may
bounce_template_file = /etc/postfix/bounce.cf

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
relayhost = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4

virtual_mailbox_domains = mybrat.bratgroup.com

virtual_mailbox_maps =

This document (7010291) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 1
PostFix

Situation

Unknown Mail Transport Error messages in the PostFix log.
File pile up in the mailq folder

Resolution

 Make sure the file is owned by root.

Also, make it has the rights of  -rw-r—r—.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented «AS IS» WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7010291
  • Creation Date:
    12-Mar-2012
  • Modified Date:28-Sep-2022
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

Здравствуйте. Я не очень хорош в почтовиках, но вот понадобилось настроить почтовый сервер.
Скомпилировав рекомендации из нескольких статей и даже почитав документацию, я получил более-менее рабочее решение. Ну в том смысле, что я не до конца понимаю, как оно работает, но получаю ожидаемый результат. Вернее, не всегда получаю ожидаемый результат, что и привело меня на форум.

Итак, когда я делаю вот так: cat /tmp/test |mail test@testdomain.ru , то письмо падает в локальный каталог с почтой. А если я пробую отправить письмо с помощью telnet вот так:

Код: Выделить всё

telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 SRVNAME ESMTP Postfix (Debian/GNU)
helo test@testdomain.ru
250 SRVNAME
mail from:<test@testdomain.ru>
250 2.1.0 Ok
rcpt to:<test@testdomain.ru>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
.
250 2.0.0 Ok: queued as 6B3EF23F923

То письмо уничтожается, с таким логом:

Код: Выделить всё

Jan  7 19:43:36 SRVNAME postfix/smtpd[16839]: connect from localhost[127.0.0.1]
Jan  7 19:43:52 SRVNAME postfix/smtpd[16839]: 6B3EF23F923: client=localhost[127.0.0.1]
Jan  7 19:43:57 SRVNAME postfix/cleanup[16846]: 6B3EF23F923: hold: header Received: from test?testdomain.ru (localhost [127.0.0.1])??by SRVNAME (Postfix) with SMTP id 6B3EF23F923??for <test@testdomain.ru>; Sat,  7 Jan 2017 19:43:45 +0300 (MSK) from localhost[127.0.0.1]; from=<test@testdomain.ru> to=<test@testdomain.ru> proto=SMTP helo=<test?testdomain.ru>
Jan  7 19:43:57 SRVNAME postfix/cleanup[16846]: 6B3EF23F923: message-id=<20170107164352.6B3EF23F923@SRVNAME>
Jan  7 19:43:57 SRVNAME MailScanner[13198]: New Batch: Scanning 1 messages, 954 bytes
Jan  7 19:43:57 SRVNAME MailScanner[13198]: Virus and Content Scanning: Starting
Jan  7 19:44:13 SRVNAME MailScanner[13198]: Requeue: 6B3EF23F923.AA452 to A613E24096B
Jan  7 19:44:13 SRVNAME postfix/qmgr[11496]: A613E24096B: from=<test@testdomain.ru>, size=320, nrcpt=1 (queue active)
Jan  7 19:44:13 SRVNAME postfix/qmgr[11496]: warning: connect to transport private/spamfilter: No such file or directory
Jan  7 19:44:13 SRVNAME MailScanner[13198]: Uninfected: Delivered 1 messages
Jan  7 19:44:13 SRVNAME MailScanner[13198]: Deleted 1 messages from processing-database
Jan  7 19:44:13 SRVNAME postfix/error[16868]: A613E24096B: to=<test@testdomain.ru>, relay=none, delay=28, delays=28/0.01/0/0.05, dsn=4.3.0, status=deferred (mail transport unavailable)
Jan  7 19:44:40 SRVNAME postfix/smtpd[16839]: lost connection after UNKNOWN from localhost[127.0.0.1]
Jan  7 19:44:40 SRVNAME postfix/smtpd[16839]: disconnect from localhost[127.0.0.1]

Я полагаю, проблема где-то между warning: connect to transport private/spamfilter: No such file or directory и status=deferred (mail transport unavailable) . Но понять ничего не выходит, к сожалению.

Пожалуй, покажу конфиги:

Код: Выделить всё

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert.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

myhostname = SRVNAME

#For mailscanner
header_checks = regexp:/etc/postfix/header_checks

#Время, в течении которого письма будут находится в очереди
maximal_queue_lifetime = 5d
#Ограничение на размер письма в байтах
message_size_limit = 10000000
#Дополнительные файлы конфигурации
additional_config_dir             = /etc/postfix/config
alias_maps                        = hash:/etc/aliases
#Список доменов, для которых почта будет доставляться локально, а не пересылаться на другой хост.
mydestination                     = $myhostname, localhost, localhost.$mydomain, $myhostname.$mydomain
#Локальные сети
mynetworks                        = 127.0.0.0/8 192.168.251.0/24
#Карта алиасов
virtual_alias_maps                = proxy:mysql:$additional_config_dir/mysql-virtual_forwardings.cf, mysql:$additional_config_dir/mysql-virtual_email2email.cf
#Карта расположения почтовых ящиков
virtual_mailbox_maps              = proxy:mysql:$additional_config_dir/mysql-virtual_mailboxes.cf
#Содержит имена обслуживаемых доменов
virtual_mailbox_domains           = proxy:mysql:$additional_config_dir/mysql-virtual_domains.cf
#Нужен чтобы по MAIL FROM узнать логин и затем сверить с логином, по которому прошла аутентификация.
smtpd_sender_login_maps           = mysql:$additional_config_dir/mysql-virtual_email2email.cf
#Путь до каталога хранилища почты
virtual_mailbox_base              = /var/spool/postfix/maildir
#Карта UID-ов виртуальных пользователей
virtual_uid_maps                  = static:5000
#Тоже самое для групп:
virtual_gid_maps                  = static:5000
#Поддержку sasl авторизации
smtpd_sasl_auth_enable            = yes
#Поддержки старых версий почтовых клиентов, например Microsoft Outlook Express 4 и Microsoft Exchange 5, использующих другую форму команды AUTH
broken_sasl_auth_clients          = yes
#Требуем, чтобы удаленный SMTP клиент представлял себя в начале SMTP сессии с помощью команды HELO или EHLO.
smtpd_helo_required               = yes
#Всегда отправлять EHLO вначале SMTP сессии
smtp_always_send_ehlo = yes
#Отключает SMTP команду VRFY. В результате чего, невозможно определить существование определенного
#ящика. Данная техника (применение команды VRFY) используется спамерами для сбора имен почтовых ящиков.
disable_vrfy_command = yes
#Сообщать ли клиентам о возможности использования TLS (шифрования соединения)
smtpd_use_tls                     = yes
#Карта транспорта
transport_maps                    = proxy:mysql:$additional_config_dir/mysql-virtual_transports.cf
#Список таблиц, которым разрешено работать через proxymap (кэширует запросы и снижает нагрузку на БД)
proxy_read_maps                   = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
#Создаем классы:
smtpd_restriction_classes         = verify_sender, rbl_cbl_abuseat_org, rbl_sbl_spamhaus_org, rbl_dul_ru, rbl_spamcop, white_client_ip,
                    #black_client_ip,
                    block_dsl, helo_access, white_client, mx_access
#Описание классов:
verify_sender                     = reject_unverified_sender, permit
rbl_cbl_abuseat_org               = reject_rbl_client cbl.abuseat.org
rbl_dul_ru                        = reject_rbl_client dul.ru
rbl_sbl_spamhaus_org              = reject_rbl_client sbl.spamhaus.org
rbl_spamcop                       = reject_rbl_client bl.spamcop.net
#IP адреса, которые нужно пропускать не смотря ни на что
white_client_ip                   = check_client_access hash:$additional_config_dir/white_client_ip
###IP адреса, которые нужно блокировать не смотря ни на что
###black_client_ip                   = check_client_access hash:$additional_config_dir/black_client_ip
#Правила для блокировки dsl/модемных пулов, с которых подключаются клиенты.
block_dsl                         = regexp:$additional_config_dir/block_dsl
#Соблюдение документа RFC 2821
helo_access                       = check_helo_access pcre:$additional_config_dir/helo_checks
white_client                      = check_sender_access pcre:$additional_config_dir/access_vip_sender
mx_access                         = check_sender_mx_access cidr:$additional_config_dir/mx_access
#Далее restrictions:

#Проверки клиентского компьютера (или другого почтового сервера),
#который соединяется с сервером postfix для отправки письма
smtpd_client_restrictions         =
                                    #black_client_ip,
                                    #Принимать письма от клиентов локальной сети
                                    permit_mynetworks,
                                    #Пропускать письма от авторизованный пользователей
                                    permit_sasl_authenticated,
                                    #Если клиент не из mynetworks оценивает reject_unauth_destination. Отклоняется попытки пересылки, если получатель
#сообщения не относится к доменам места назначения и доменам пересылки, указанным в ваших настройках
                                    reject_unauth_destination,
                                    white_client_ip,
                                    #Отвергает запрос, когда клиент отправляет команды SMTP раньше времени, еще не зная о том,
                                    #действительно ли Postfix поддерживает конвейерную обработку команд ESMTP
                                    reject_unauth_pipelining,
                                    helo_access,
                                    block_dsl,
                                    #блокируем клиентов с адресами from, домены которых не имеют A/MX записей
                                    ###reject_unknown_address,
                                    #блокирует почту от несуществующих доменов
                                    ###reject_unknown_recipient_domain,
                                    ###Проверяем домен на записи типа A и MX в DNS — если нет, то отклоняем
                                    ###reject_unknown_sender_domain,
                                    rbl_dul_ru,
                                    rbl_sbl_spamhaus_org,
                                    rbl_spamcop,
                                    rbl_cbl_abuseat_org
#Проверки исходящей или пересылаемой через нас почты
smtpd_sender_restrictions         =                                    white_client,
                                    white_client_ip,
                                    #black_client_ip,
                                    #если пользователь авторизуется как user1@domain.com и попытается передать письмо в
                                    #котором в качестве обратного адреса указан user2@domain.com, то в ответ получит ошибку
                                    reject_authenticated_sender_login_mismatch,
                                    #Отклоняет сообщения в не существующие домены
                                    reject_unknown_recipient_domain,
                                    ###Проверяем домен на записи типа A и MX в DNS — если нет, то отклоняем
                                    ###reject_unknown_sender_domain,
                                    #Если имя получателя не соответствует FQDN то отклоняем
                                    reject_non_fqdn_recipient,
                                    #Если имя отправителя не соответствует FQDN - отклоняем
                                    reject_non_fqdn_sender,
                                    permit_sasl_authenticated,
                                    permit_mynetworks,
                                    #Содержит список приватных сетей, которые по всем канонам глобальной сети интернет
                                    #не могут быть использованы в качестве IP для MX записей
                                    mx_access,
                                    #Отклонение писем с несуществующим адресом отправителя
                                    reject_unlisted_sender,
                                    #Если клиент не из mynetworks оценивает reject_unauth_destination. Отклоняется попытки пересылки, если получатель
                                    reject_unauth_destination
#Правила приема почты нашим сервером:
smtpd_recipient_restrictions      =
                                    white_client,
                                    #блокирует почту от несуществующих доменов
                                    reject_unknown_recipient_domain,
                                    ###Проверяем домен на записи типа A и MX в DNS — если нет, то отклоняем
                                    ###reject_unknown_sender_domain,
                                    #Если имя получателя не соответствует FQDN — отклоняем
                                    reject_non_fqdn_recipient,
                                    #Если имя отправителя не соответствует FQDN - отклоняем
                                    reject_non_fqdn_sender,
                                    #Отвергает запрос, когда клиент отправляет команды SMTP раньше времени, еще не зная о том,
                                    #действительно ли Postfix поддерживает конвейерную обработку команд ESMTP
                                    reject_unauth_pipelining,
                                    #Пропускать письма от авторизованный пользователей
                                    permit_sasl_authenticated,
                                    #Принимать письма от клиентов локальной сети
                                    permit_mynetworks,
                                    helo_access,
                                    #Отклонить, если адреса RCPT TO нет в допустимых получателей
                                    reject_unlisted_recipient,
                                    #блокируем клиентов с адресами from, домены которых не имеют A/MX записей
                                    reject_unknown_address,
                                    #Если клиент не из mynetworks оценивает reject_unauth_destination. Отклоняется попытки пересылки, если получатель
                                    #сообщения не относится к доменам места назначения и доменам пересылки, указанным в ваших настройках
                                    reject_unauth_destination,
                                    #Для отказа в приеме сообщениям с пустым именем отправителя конверта, предназначенным нескольким получателям
                                    reject_multi_recipient_bounce

smtpd_data_restrictions           =
                                    reject_unauth_pipelining,
                                    reject_multi_recipient_bounce,
                                    permit
#Пропустить серверы, которые приветствуют нас кодом состояния 5xx
smtp_skip_5xx_greeting            = no

#Отклонение писем с несуществующим адресом отправителя
smtpd_reject_unlisted_sender      = yes

#Отклонение писем с несуществующим адресом получателя
smtpd_reject_unlisted_recipient   = yes

Всё самое интересное при этом оказалось в БД. Вот, например, config/mysql-virtual_transports.cf :

Код: Выделить всё

user = postfix
password = password
dbname = mail
query = SELECT transport FROM transport WHERE domain='%s'
hosts = 127.0.0.1

А вот содержимое таблицы:

Код: Выделить всё

SELECT * FROM transport;

domain              transport
testdomain.ru      :

Ну и master.cf:

Код: Выделить всё

smtp      inet  n       -       -       -       -       smtpd
    -o content_filter=spamfilter:dummy
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix    -    n    n    -    2    pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
 spamfilter unix - n n - - pipe
   flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}

А вот так выглядит скрипт /usr/local/bin/spamfilter :

Код: Выделить всё

#!/bin/bash
echo $1 > /tmp/spamc
echo $2 >> /tmp/spamc
echo $3 >> /tmp/spamc
echo $4 >> /tmp/spamc
echo $5 >> /tmp/spamc

 /usr/bin/spamc | /usr/sbin/sendmail -i "$@"
 exit $?

Файлик /tmp/spamc при этом не создаётся.

В общем, вот так вот всё оно. Буду рад помощи в понимании проблемы.

View previous topic :: View next topic  
Author Message
gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Fri Sep 14, 2007 4:53 am    Post subject: postfix issues unknown mail transport error [solved] Reply with quote

i’m able to send out mail on my postfix,amavis,clamav,spamassassin. i been looking over and over and my eyes are now crossed.

i get the following

Sep 14 00:47:30 u00 postfix/qmgr[5446]: 055638D3B4: to=<user@domain.com>, relay=none, delay=1072, delays=1055/17/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

there were a handful of how-tos, and my eyes are staying crossed.

what is the relevant that i need to post? my master.cf? main.cf? amavis.cf?

i been trying to find the relavant for the above, but not doing antyhing for me.

Last edited by gohmdoree on Sun Sep 23, 2007 4:38 pm; edited 1 time in total

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Fri Sep 14, 2007 4:58 am    Post subject: Reply with quote

my main.cf

Code:

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = domain.com

mydomain = domain.com

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname localhost.$mydomain mysql:/etc/postfix/sql-domains.cf

local_recipient_maps = mysql:/etc/postfix/sql-recipients.cf

unknown_local_recipient_reject_code = 554

unknown_client_reject_code = 554

unknown_hostname_reject_code = 554

unknown_relay_recipient_reject_code = 554

unknown_sender_reject_code = 554

mynetworks = 127.0.0.0/8, mysql:/etc/postfix/sql-net.cf

default_transport = smtp

transport_maps = hash:/etc/postfix/transport

mailbox_transport = dbmail-smtp:

fast_flush_domains = $relay_domains

smtpd_banner = $myhostname ESMTP

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 10

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.3.6/html

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Fri Sep 14, 2007 5:00 am    Post subject: Reply with quote

my master.cf

Code:

smtp       inet  n       —       n       —       4       smtpd        -o content_filter=smtp-amavis:[127.0.0.1]:10024        -o receive_override_options=no_address_mappingssmtp-amavis        unix  —       —       y       —       4      smtp        -o smtp_data_done_timeout=1200        -o disable_dns_lookups=yes        -o smtp_send_xforward_command=yes127.0.0.1:10025 inet n  —       y       —       2       smtpd        -o content_filter=        -o local_recipient_maps=        -o relay_recipient_maps=        -o smtpd_restriction_classes=        -o smtpd_helo_restrictions=        -o smtpd_sender_restrictions=        -o smtpd_recipient_restrictions=permit_mynetworks,reject        -o mynetworks=127.0.0.0/8        -o strict_rfc821_envelopes=yes        -o smtpd_error_sleep_time=0        -o smtpd_soft_error_limit=1001        -o smtpd_hard_error_limit=1000        -o receive_override_options=no_header_body_checkspickup    fifo  n       —       n       60      1       pickupcleanup   unix  n       —       n       —       0       cleanupqmgr      fifo  n       —       n       300     1       qmgrtlsmgr    unix  —       —       n       1000?   1       tlsmgrrewrite   unix  —       —       n       —       —       trivial-rewritebounce    unix  —       —       n       —       0       bouncedefer     unix  —       —       n       —       0       bouncetrace     unix  —       —       n       —       0       bounceverify    unix  —       —       n       —       1       verifyflush     unix  n       —       n       1000?   0       flushproxymap  unix  —       —       n       —       —       proxymap

smtp      unix  —       —       n       —       —       smtp

relay     unix  —       —       n       —       —       smtp

        -o fallback_relay=

showq     unix  n       —       n       —       —       showq

error     unix  —       —       n       —       —       error

discard   unix  —       —       n       —       —       discard

local     unix  —       n       n       —       —       local

virtual   unix  —       n       n       —       —       virtual

lmtp      unix  —       —       n       —       —       lmtp

anvil     unix  —       —       n       —       1       anvil

scache    unix  —       —       n       —       1       scache

maildrop  unix  —       n       n       —       —       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

old-cyrus unix  —       n       n       —       —       pipe

  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}

cyrus     unix  —       n       n       —       —       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension} ${user}

virt-cyrus     unix  —       n       n       —       —       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${recipient} ${user}

uucp      unix  —       n       n       —       —       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender — $nexthop!rmail ($recipient)

ifmail    unix  —       n       n       —       —       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  —       n       n       —       —       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

dbmail-smtp     unix    —       n       n       —       —       pipe

        flags= user=dbmail:dbmail argv=/usr/sbin/dbmail-smtp -d ${recipient} -r ${sender}

Back to top

View user's profile Send private message

bunder
Bodhisattva
Bodhisattva

Joined: 10 Apr 2004
Posts: 5930

PostPosted: Fri Sep 14, 2007 5:01 am    Post subject: Reply with quote

Moved from Other Things Gentoo to Networking & Security.
_________________

Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.



banned from #gentoo since sept 2017

Back to top

View user's profile Send private message

elgato319
Guru
Guru

Joined: 15 Sep 2005
Posts: 546

PostPosted: Fri Sep 14, 2007 12:30 pm    Post subject: Reply with quote

which tutorials were you following?

postfix is only the mta, what kind of imap/pop server do you use?
Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Sat Sep 15, 2007 8:02 pm    Post subject: Reply with quote

using dbmail. i take it by your questioning, maybe a dbmail configuration issue.
Back to top

View user's profile Send private message

boudewijn
Apprentice
Apprentice

Joined: 11 Jan 2005
Posts: 257
Location: Netherlands

PostPosted: Sat Sep 15, 2007 11:30 pm    Post subject: Reply with quote

I’ve got the same error:

https://forums.gentoo.org/viewtopic-p-4241243.html#4241243

it’s definitely postfix ;)
_________________
Mijn Nederlandstalige Gentoo forum:

http://www.gentoo-forum.nl

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Sat Sep 15, 2007 11:39 pm    Post subject: Reply with quote

i think it was just a lot of things going on, things to set that i missed the key.

Code:

mailbox_transport = dbmail-smtp:

it should have been:

Code:

mailbox_transport = dbmail-smtp:[127.0.0.1]:24

i read somewhere else that my error meant that amavisd couldn’t connect back with postfix. i’m using dbmail for my setup.

also in the virtual and transport hash i have the following:

Code:

*               dbmail-smtp:[127.0.0.1]:10024

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Sun Sep 23, 2007 12:24 am    Post subject: Reply with quote

the one thing that i’m noticing is that i can’t send mail out. it takes it, and returns undeliverable, stating user unknown. from what i understand, i guess postfix understands itself to be the last stop, so its trying to find the respective email address on the local machine?

not sure what configuration needs to change from what i have above.

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Sun Sep 23, 2007 12:29 am    Post subject: Reply with quote

actually made some changes, here is my current

Code:

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = machine.com

mydomain = machine.com

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname, $mydomain, localhost.$mydomain, mysql:/etc/postfix/sql-domains.cf

local_recipient_maps = mysql:/etc/postfix/sql-recipients.cf

unknown_local_recipient_reject_code = 554

unknown_client_reject_code = 554

unknown_hostname_reject_code = 554

unknown_relay_recipient_reject_code = 554

unknown_sender_reject_code = 554

mynetworks = 127.0.0.0/8, mysql:/etc/postfix/sql-net.cf

default_transport = smtp

transport_maps = hash:/etc/postfix/transport

mailbox_transport = dbmail-smtp:[127.0.0.1]:24

fast_flush_domains = $relay_domains

smtpd_banner = $myhostname ESMTP

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 10

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.3.6/html

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

readme_directory = /usr/share/doc/postfix-2.3.6/readme

message_size_limit = 10485760

smtpd_etrn_restrictions = permit_mynetworks, reject

smtpd_history_flush_threshold = 100

smtpd_recipient_limit = 50

smtpd_timeout = 300s

strict_rfc821_envelopes = yes

invalid_hostname_reject_code = 554

non_fqdn_reject_code = 554

relay_domains_reject_code = 554

smtpd_soft_error_limit = 10

smtpd_hard_error_limit = 100

smtpd_helo_required = yes

disable_vrfy_command = yes

virtual_alias_maps = hash:/etc/postfix/virtual

alias_maps = hash:/etc/aliases

header_checks = pcre:/etc/postfix/pcre-header.cf

body_checks = pcre:/etc/postfix/pcre-body.cf

smtpd_helo_restrictions = 

        permit_mynetworks,

        reject_invalid_hostname,

        check_helo_access regexp:/etc/postfix/reject_helo,

        permit

smtpd_recipient_restrictions =

        permit_mynetworks,

        reject_invalid_hostname,

        reject_unauth_pipelining,

        reject_unknown_recipient_domain,

        reject_non_fqdn_sender,

        reject_non_fqdn_recipient,

        reject_unauth_destination,

        reject_unlisted_recipient,

        reject_rbl_client multi.uribl.com,

        reject_rbl_client dsn.rfc-ignorant.org,

        reject_rbl_client dul.dnsbl.sorbs.net,

        reject_rbl_client list.dsbl.org,

        reject_rbl_client sbl-xbl.spamhaus.org,

        reject_rbl_client bl.spamcop.net,

        reject_rbl_client dnsbl.sorbs.net,

        reject_rbl_client cbl.abuseat.org,

        reject_rbl_client ix.dnsbl.manitu.net,

        reject_rbl_client combined.rbl.msrbl.net,

        reject_rbl_client rabl.nuclearelephant.com,

        permit_mx_backup,

        permit

smtpd_sender_restrictions =

        permit_mynetworks,

        check_sender_access mysql:/etc/postfix/sql-access.cf,

        reject_unknown_sender_domain,

        permit

allow_untrusted_routing = no

maximal_queue_lifetime = 5d

default_process_limit = 512

mime_header_checks = regexp:/etc/postfix/mime_header_checks

smtpd_client_restrictions =

        reject_rbl_client proxies.blackholes.wirehub.net,

        reject_rbl_client blackholes.easynet.nl,

        reject_rbl_client bl.spamcop.net,

        reject_rbl_client cbl.abuseat.org,

        permit_mynetworks

smtpd_delay_reject = no

smtpd_data_restrictions =

        reject_unauth_pipelining,

        permit_mynetworks,

        permit_auth_destination,

        permit_mx_backup,

        permit

html_directory = no

and the master.cf

Code:

localhost:smtp       inet  n       —       n       —       4       smtpd

        -o content_filter=smtp-amavis:[127.0.0.1]:10024

        -o receive_override_options=no_address_mappings

smtp-amavis        unix  —       —       n       —       6      smtp

        -o smtp_data_done_timeout=1200

        -o disable_dns_lookups=yes

127.0.0.1:10025 inet n  —       n       —       2       smtpd

        -o content_filter=

        -o local_recipient_maps=

        -o relay_recipient_maps=

        -o smtpd_restriction_classes=

        -o smtpd_client_restrictions=   

        -o smtpd_helo_restrictions=     

        -o smtpd_sender_restrictions=   

        -o smtpd_recipient_restrictions=permit_mynetworks,reject

        -o mynetworks=127.0.0.0/8       

        -o strict_rfc821_envelopes=yes 

        -o smtpd_error_sleep_time=0     

        -o smtpd_soft_error_limit=1001 

        -o smtpd_hard_error_limit=1000 

pickup    fifo  n       —       n       60      1       pickup

cleanup   unix  n       —       n       —       0       cleanup

qmgr      fifo  n       —       n       300     1       qmgr

tlsmgr    unix  —       —       n       1000?   1       tlsmgr

rewrite   unix  —       —       n       —       —       trivial-rewrite

bounce    unix  —       —       n       —       0       bounce

defer     unix  —       —       n       —       0       bounce

trace     unix  —       —       n       —       0       bounce

verify    unix  —       —       n       —       1       verify

flush     unix  n       —       n       1000?   0       flush

proxymap  unix  —       —       n       —       —       proxymap

smtp      unix  —       —       n       —       —       smtp

relay     unix  —       —       n       —       —       smtp

        -o fallback_relay=

showq     unix  n       —       n       —       —       showq

error     unix  —       —       n       —       —       error

discard   unix  —       —       n       —       —       discard

local     unix  —       n       n       —       —       local

virtual   unix  —       n       n       —       —       virtual

lmtp      unix  —       —       n       —       —       lmtp

anvil     unix  —       —       n       —       1       anvil

scache    unix  —       —       n       —       1       scache

maildrop  unix  —       n       n       —       —       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

old-cyrus unix  —       n       n       —       —       pipe

  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}

cyrus     unix  —       n       n       —       —       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension} ${user}

virt-cyrus     unix  —       n       n       —       —       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${recipient} ${user}

uucp      unix  —       n       n       —       —       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender — $nexthop!rmail ($recipient)

ifmail    unix  —       n       n       —       —       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  —       n       n       —       —       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

dbmail-smtp     unix    —       n       n       —       —       pipe

        flags= user=dbmail:dbmail argv=/usr/sbin/dbmail-smtp -d ${recipient} -r ${sender}

[/b]

Back to top

View user's profile Send private message

gohmdoree
Guru
Guru

Joined: 12 Oct 2004
Posts: 533

PostPosted: Sun Sep 23, 2007 4:38 pm    Post subject: Reply with quote

closing this thread since original issue was solved.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Понравилась статья? Поделить с друзьями:
  • Unknown isc error 336330835
  • Unknown internal pro render error cinema 4d
  • Unknown internal operating system error bde
  • Unknown internal error leapdroid
  • Unknown inject error system dllnotfoundexception trx