Register
It is currently Tue Jul 29, 2014 4:55 pm

smtpd in bash with a bug(run via inetd ot tcpsvd)


All times are UTC - 6 hours


Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 PostPosted: Sat Apr 30, 2011 2:35 pm   

Joined: Tue Mar 29, 2011 10:14 pm
Posts: 32
Thanks *grins*
I like easy, and even more, I like fewer files.

And just a thought.

Would it help if at the end of the script if I fed all the variables(which now contain values, in particular the message variable) blank values, with the thought being to clean up the memory being used by those variables?


Top
 Profile  
 PostPosted: Sun May 01, 2011 1:41 am   
User avatar

Joined: Sun Jun 27, 2010 12:57 am
Posts: 192
All variables used in a script are local to that running instance (unless they are EXPORT'ed beforehand) So when the script stops, all the information in the variables is gone. Emptying them would only make sense if you let the script run in a continuous loop.


Top
 Profile  
 PostPosted: Wed May 04, 2011 1:14 pm   
User avatar

Joined: Sun Jun 27, 2010 12:57 am
Posts: 192
Just been reading a bit through your latest incarnation and noticed that for relaying you telnet to 'smtp.<domainname>' port 25. Not all (I'm guessing rather few) mailservers for domains are just called 'smtp.<domainname>'. To get the proper mailservers of a domain, you could do something like the following:
Code:
dig +noall +answer <domainname.tld> MX | sort -nk5

This will return the Mail eXchange records for a domain, in this case nicely sorted by priority (fifth column). The last/sixth column is the actual server name.


Last edited by Patsie on Wed May 04, 2011 1:15 pm, edited 1 time in total.

Top
 Profile  
 PostPosted: Wed May 04, 2011 1:15 pm   
User avatar

Joined: Sun Jun 27, 2010 12:57 am
Posts: 192
sorry.. double posting...


Top
 Profile  
 PostPosted: Sat May 07, 2011 12:52 am   

Joined: Tue Mar 29, 2011 10:14 pm
Posts: 32
Well, the telnet stuff was just kinda' codgered in from one of the earlier mutations as a way to include some sort of relaying between mailservers.

I really haven't even fiddled with it because I don't have a "real" domain name here and as such reverse lookups won't work........so modern spamaphobic mailservers will dump any requests I make before I can even get a foot in the door, so, like I said it's just a stub.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 11 guests


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 post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP