New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SMTP and APIUpdated 26 Oct 2026

Mail Submission vs Mail Transfer: Why Port 587 and Port 25 Are Different Jobs

The difference between message submission (MSA) and mail transfer (MTA): ports 587, 465 and 25, authentication, policy checks, header repair, who may use each, why providers block port 25 and how to set up both roles safely.

MO
Written by Mateus Oliveira
Senior SMTP and MTA Engineer
Reviewed by Tomasz Kowalski
  • Published5 Dec 2024
  • Read time6 min
  • Length1,306 words
Share this guide

People often say "SMTP server" as if there were one kind. In practice a mail system has two distinct doors that speak the same protocol but do different jobs. One door accepts mail from users and applications that want to send something, and it expects them to identify themselves. The other door accepts mail from other mail servers on behalf of the domains it hosts, and it must accept mail from strangers. Mixing them up leads to the most common configuration problems: applications that cannot connect because they use the wrong port, servers that accept anything (open relays), or recipients that reject mail because it arrived on the wrong path. This guide explains the roles, the ports, what each role should check and repair, and how to configure them. It builds on what an MTA is, which port to use and open relay checks.

Submission (MSA)Port 587 or 465; authenticated users and apps hand over mail; the server may fix and police it
Transfer (MTA)Port 25; servers deliver mail to each other; no login, but strict acceptance rules for local domains
Why separateDifferent trust, different policy, different abuse risk
PracticeUse submission for sending from apps; use port 25 only between servers

The roles

RoleNameTypical portsWho connectsAuthentication
Mail User Agent (MUA)The client: a mail program, a script or an applicationn/aStarts the connectionProvides credentials
Mail Submission Agent (MSA)Accepts new mail from authenticated clients (RFC 6409)587 (STARTTLS) and 465 (implicit TLS)Users, devices and applicationsRequired
Mail Transfer Agent (MTA)Relays mail between servers and delivers to local domains25Other mail serversNot used for ordinary delivery
Mail Delivery Agent (MDA)Puts the message into the mailboxn/a (local)The MTAn/a
Mail Access (IMAP/POP3)Lets users read stored mail143/993, 110/995UsersRequired

One software package such as Postfix or Exim often runs both the MSA and MTA roles, using different listeners and policies. A managed relay is, from your application's point of view, an MSA that then performs the MTA work of delivering to the world.

What the submission service does

  • Requires authentication and encryption. Only known users or applications may inject mail, over TLS. See AUTH mechanisms.
  • Enforces sender policy. The authenticated user may send only from permitted addresses or domains; this stops one tenant from forging another. See tenant sending.
  • Repairs incomplete messages. A submission server may add a missing Date or Message-ID, rewrite local names to full addresses, add a Sender header or correct the envelope. See the Date header and Message-ID.
  • Applies limits. Per-user and per-minute rate limits, recipient counts and size limits. See rate shaping.
  • Signs the message. DKIM signing normally happens here, after repairs and before delivery. See signed headers.
  • Scans and logs. Outbound spam detection protects the shared reputation of the sending IP.
  • Queues and delivers through its MTA component, with retries. See retry schedules.

What the transfer service does

  • Accepts mail for local domains only. It must refuse to relay mail between two outside domains for an unauthenticated client; otherwise it is an open relay.
  • Validates recipients at SMTP time to avoid backscatter. See the null sender.
  • Checks the sender: reverse DNS, HELO, blocklists, SPF, DKIM and DMARC, and spam content. See FCrDNS and authentication results.
  • Does not repair messages in the same way. A message arriving on port 25 is expected to be complete already.
  • Tolerates unknown clients but defends with greeting delays, limits and greylisting. See the SMTP banner.

Why port 25 is blocked for end users

Because port 25 requires no authentication to deliver to the world, malware on a desktop or a compromised server can send spam directly from the victim's IP address. Internet providers and cloud platforms therefore block outbound connections to port 25 from customer networks, sometimes lifting the block on request after vetting. The block is not a fault; it pushes legitimate senders to submission through an authenticated relay, where abuse can be limited per account. If an application cannot reach a relay on port 25, the solution is to use 587 or 465 with credentials, not to ask for the block to be removed. See connection timeouts.

The three ports compared

PortNameEncryptionUseCommon problem
25SMTP (MTA to MTA)Opportunistic STARTTLSServer-to-server deliveryBlocked outbound by providers; do not use for app submission
587SubmissionSTARTTLS (required by policy)Clients and applications to a serverClient skips STARTTLS or the AUTH step
465SMTPS / submission over implicit TLSTLS from the first byte (re-standardised in RFC 8314)Clients and applications; preferred by some providersClient tries STARTTLS on a port that expects TLS immediately
2525Unofficial alternativeSame as 587When 587 is blocked by a networkNot universally available

Setting up submission in Postfix

# /etc/postfix/master.cf  (submission service on 587)
submission inet n - y - - smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_tls_auth_only=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sender_login_maps=hash:/etc/postfix/sender_logins
  -o smtpd_sender_restrictions=reject_sender_login_mismatch
  -o cleanup_service_name=authclean

# Implicit TLS on 465
smtps inet n - y - - smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject

The key points are the encryption requirement, authentication, a relay policy that permits only authenticated users and a mapping that ties each login to the sender addresses it may use. The public port 25 service keeps a different policy: reject_unauth_destination so only local domains are accepted from strangers.

Why not use one port for everything

It is tempting to run a single listener that accepts both strangers and logged-in users, and some small servers do. The cost is complexity in every rule: the same service must accept unauthenticated mail for local recipients, refuse it for everyone else, require encryption only for some clients and apply different limits and repairs depending on who connected. Separate listeners make each policy simple and testable, let you firewall or monitor them independently and allow you to move the submission service to different hardware or a different provider without touching your public MX. They also make incident response easier: if a credential leaks, you can cut off the submission service while mail from the outside world continues to arrive.

Common problems

ProblemCauseFix
Application cannot send, "connection timed out" on 25Provider blocks port 25Use 587 or 465 with authentication
"Relay access denied" on submissionClient not authenticated, or sender not permittedCheck AUTH, TLS and the sender login map
"Must issue a STARTTLS command first"Client attempts AUTH before upgradingEnable STARTTLS or use port 465
Mail accepted but marked as spoofed by recipientsSubmitted From address not authorised for the domainAlign SPF, DKIM and DMARC. See envelope From
Users can send as anyoneNo sender-login enforcementAdd sender restrictions on the submission service
Internal devices cannot use TLSOld firmwareUse an internal relay that accepts the device and forwards over TLS, restricted by IP

Choosing the right path for your application

  1. If the application sends through a provider, use the provider's submission host on 587 or 465 with a dedicated credential, or its HTTP API. See the email API.
  2. If the application sends through your own server, create a submission service and an account per application.
  3. If devices only support port 25 without TLS, place a small internal relay on a trusted network segment, restrict it by source address and have it forward to the submission service of your real relay.
  4. Test with a transcript to confirm the sequence: banner, EHLO, STARTTLS, AUTH, MAIL FROM. See reading a transcript.
  5. Monitor the submission service separately from the public MX, with its own alerts. See SMTP monitoring.

Submission and transfer share a protocol but not a purpose. Keep port 587 or 465 for authenticated senders, with encryption, policy and logging, keep port 25 for server-to-server mail with strict acceptance rules and your sending stays both reliable and safe.

Use a managed submission service Authenticated sending on standard ports.

Explore SMTP relay

References and further reading

Frequently asked questions

What is the difference between port 25 and port 587?

Port 25 is for server-to-server mail transfer; port 587 is for authenticated submission of new mail by users and applications.

Why is port 25 blocked by many providers?

It needs no login to deliver mail anywhere, so infected machines use it to send spam; blocking it pushes senders toward authenticated submission.

Should I use 465 or 587?

Either works. 465 uses TLS from the first byte; 587 starts plain and upgrades with STARTTLS. Use what your provider documents.

What does a submission server do that an MTA does not?

It authenticates senders, enforces sender policy, can repair headers, applies limits and signs messages.

How do I send from a device that only supports port 25?

Use a restricted internal relay that accepts the device and forwards over an authenticated, encrypted submission connection.

Topics#submission#msa#mta#port 587#port 25
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales