Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th November 2009, 15:08
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default How to manage postfix queue so that I'll send email just on request

Hi to everybody.
I've create a main mailserver and a local mailserver.
The local mailserver will relay all the emails to be sent to the main mailserver, that phisically do the job.
The local mailserver will fetch the email arrived from the main mailserver with fetchmail.
Now, this is the issue:
I've setup the local mailserver so that every email to be sent is relay to the main mailserver. But I don't want that every email is relayed automatically... I want to use the queue of postfix and put all the email in "hold", so that, with a script, I'll send manually every email.

How to setup the queue to put the emails in "hold" and not send them directly?

Thanks
Michele
Reply With Quote
Sponsored Links
  #2  
Old 24th November 2009, 15:21
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default

This is the main.cf that I've now:
Code:
# 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 = /etc/mailname

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

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix

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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = hostname
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = hostname, localhost
relayhost =

#relayhost = [127.0.0.1]:11125  This is just if we have the SSH tunnel

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "EXTENSION" 
mailbox_size_limit = 0
recipient_delimiter = +

inet_interfaces = all

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


virtual_alias_domains =
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtp_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
smtpd_tls_security_level = may

transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = 
virtual_mailbox_limit_override = 
virtual_maildir_limit_message = 
virtual_overquota_bounce = 

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 $virtual_mailbox_limit_maps

maildrop_destination_concurrency_limit = 1  
maildrop_destination_recipient_limit = 1  
virtual_transport = maildrop
receive_override_option = no_address_mappings
Suggestions?
Thanks
Michele
Reply With Quote
  #3  
Old 24th November 2009, 17:28
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default

After an afternoon on google I've found something what should be ok:
-I'll add in master.cf:
Code:
hold unix - - n - - smtp
-I'll add in main.cf this lines:
Code:
virtual_transport=hold
default_transport=hold
defer_transport=hold
-in main.cf, where there is:
Code:
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
I'll write in that database
Code:
hold:[mail.domain.com]
instead of
Code:
smtp:[mail.domain.com]
Now all the emails that I'll try to send from the local mailhost are queued in deferred transport and I've to send them manually.
The only thing now is: how can I put all the email that I'll try to send to "hold" insted of "defer"?
I know the command to do it one by one, but I would like to have this configuration directly by postfix...

Thanks
Michele
Reply With Quote
  #4  
Old 27th November 2009, 11:07
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default

Guys, for some reason with my configuration I can try to send email just with telnet 25 (SMTP), but If I'm trying to telnet the POP3 or IMAP, I've a login error...

Any suggestions?

Thanks
Reply With Quote
  #5  
Old 27th November 2009, 11:26
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

nice monologue you're having here ;-)

anyway, may i asked why you want a delay in sending email?
you know how annoying that it? ;-)
Reply With Quote
  #6  
Old 27th November 2009, 11:48
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default

Yes it was a monologue...
I need to make a queue of emails because this mailserver will be connected on internet with a very expensive connection...

Any idea of why I'm having login error with POP3?

Thanks
Michele
Reply With Quote
  #7  
Old 27th November 2009, 13:14
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

Check if those processes are running

Code:
netstat -tapn | grep ':25'
Reply With Quote
  #8  
Old 27th November 2009, 14:01
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default

Yes the processes are running:
Code:
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      4747/master
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      2336/couriertcpd
I can send email via telnet 25, but if I telnet 110, I can not login...
Reply With Quote
  #9  
Old 27th November 2009, 14:07
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

check the logfiles for errors
Reply With Quote
  #10  
Old 2nd December 2009, 03:04
btomasik btomasik is offline
Junior Member
 
Join Date: Nov 2009
Posts: 18
Thanks: 2
Thanked 0 Times in 0 Posts
 
Default

What software are you using for pop3?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail server using Postfix, Dovecot, Mysql... Postfix virtual maps doesn't work?? tarasbuljba HOWTO-Related Questions 33 28th May 2010 14:33
postfix, pop3 uvbnserved Server Operation 22 24th May 2009 21:00
hotmail rejects outgoing email nzimas Server Operation 3 1st May 2009 03:39
Postfix won't receive external email fred!head Server Operation 2 29th June 2008 19:30
Postfix mail is held in queue indefinitely... squallbsr Server Operation 9 15th January 2006 19:13


All times are GMT +2. The time now is 19:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.